/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1f2937;
    background: #fff;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Navbar */
.navbar {
    background: #1e293b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 52px;
}
.nav-brand a { color: #fff; font-weight: 700; font-size: 1.1rem; }
.nav-brand a:hover { text-decoration: none; }
.nav-links a { color: #cbd5e1; margin-left: 1.5rem; font-size: 0.9rem; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-logout-btn {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: 1.5rem;
    padding: 0;
    font-family: inherit;
}
.nav-logout-btn:hover { color: #fff; }

/* Container */
.container {
    max-width: 1100px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

/* Flash messages */
.flash {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.flash-success { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }
.flash-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.flash-warning { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }

/* Cards & Panels */
.card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
    background: #f3f4f6;
}
tr:hover td { background: #f9fafb; }

/* Status badges */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-up      { background: #dcfce7; color: #166534; }
.badge-down    { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-unknown { background: #e5e7eb; color: #6b7280; }
.badge-paused  { background: #e0e7ff; color: #3730a3; }

/* Forms */
label {
    display: block;
    margin-top: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
}
input[type="text"],
input[type="password"],
input[type="url"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    margin-top: 4px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.5;
}
.btn:hover { text-decoration: none; }
.btn-primary   { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger    { background: #dc2626; color: #fff; }
.btn-danger:hover  { background: #b91c1c; }
.btn-secondary { background: #e5e7eb; color: #374151; }
.btn-secondary:hover { background: #d1d5db; }
.btn-sm { padding: 4px 12px; font-size: 0.8rem; }

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Login page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-box {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    width: 100%;
    max-width: 380px;
}
.login-box h1 { text-align: center; margin-bottom: 1.5rem; font-size: 1.4rem; }
.login-box button {
    width: 100%;
    margin-top: 1.5rem;
    padding: 10px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}
.login-box button:hover { background: #1d4ed8; }

/* Summary stats */
.stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    flex: 1;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 1rem 1.25rem;
    text-align: center;
}
.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
}
.stat-card .stat-label {
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Report navigation */
.month-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.month-nav h2 { font-size: 1.2rem; min-width: 180px; text-align: center; }

/* Chart container */
.chart-container {
    position: relative;
    height: 350px;
    margin-bottom: 1.5rem;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    color: #9ca3af;
    font-size: 0.8rem;
}

/* Checkbox inline */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}
.checkbox-row input[type="checkbox"] { width: auto; }

/* Settings sections */
.settings-section { margin-bottom: 2rem; }
.settings-section h3 {
    font-size: 1rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Inline form row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar { flex-direction: column; height: auto; padding: 0.75rem; gap: 0.5rem; }
    .nav-links a { margin-left: 0.75rem; }
    .stats-row { flex-direction: column; }
    .form-row { grid-template-columns: 1fr; }
    table { font-size: 0.85rem; }
    th, td { padding: 0.4rem 0.5rem; }
}
