:root {
    --bg: #ffffff;
    --bg-admin: #f1f5f9;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;

    --primary: #00B894;
    /* Statuspage Green */
    --secondary: #FDCB6E;
    /* Degraded Yellow */
    --accent: #E17055;
    /* Outage Red */
    --maintenance: #0984e3;
    /* Blue */

    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 8px;
    --font: 'Inter', system-ui, sans-serif;

    --global-bg: #10B981;
    --global-text: #ffffff;
}

[data-theme="dark"] {
    --bg: #0D1117;
    /* GitHub Dark bg */
    --bg-admin: #161b22;
    --surface: #161b22;
    --text: #c9d1d9;
    --text-muted: #8b949e;
    --border: #30363d;

    --global-bg: #238636;
}

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

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    transition: background-color 0.2s, color 0.2s;
}

/* Admin Panel */
.admin-panel {
    background-color: var(--bg-admin);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.admin-panel h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.control-group {
    display: flex;
    gap: 0.75rem;
}

/* Global Container */
.container {
    max-width: 850px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

#brand-name[contenteditable="true"] {
    border-bottom: 1px dashed var(--border);
    outline: none;
}

/* System Status */
.system-status {
    background-color: var(--global-bg);
    color: var(--global-text);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
    font-size: 1.15rem;
    font-weight: 500;
}

.system-status.degraded {
    background-color: var(--secondary);
    color: #1e293b;
}

.system-status.partial {
    background-color: var(--accent);
    color: #ffffff;
}

.system-status.outage {
    background-color: #d63031;
    color: #ffffff;
}

.system-status.maintenance {
    background-color: var(--maintenance);
    color: #ffffff;
}

.status-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

/* Components */
.components-wrapper {
    margin-bottom: 4rem;
}

.components-list {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.component-item {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.2s;
}

.component-item:hover {
    background-color: rgba(128, 128, 128, 0.05);
}

.component-item:last-child {
    border-bottom: none;
}

.comp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.comp-name {
    font-weight: 500;
    font-size: 1.05rem;
}

.comp-status {
    font-weight: 500;
    font-size: 0.9rem;
}

.text-operational {
    color: var(--primary);
}

.text-degraded {
    color: var(--secondary);
}

.text-partial,
.text-outage {
    color: var(--accent);
}

.text-maintenance {
    color: var(--maintenance);
}

/* Uptime Bar */
.uptime-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.uptime-bar {
    display: flex;
    height: 32px;
    gap: 2px;
}

.uptime-day {
    flex: 1;
    background-color: var(--primary);
    border-radius: 2px;
    min-width: 3px;
}

.uptime-day.down {
    background-color: var(--accent);
}

.uptime-day.deg {
    background-color: var(--secondary);
}

.uptime-day.maint {
    background-color: var(--maintenance);
}

/* Incidents */
.incident-card {
    margin-bottom: 2rem;
}

.incident-date {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.incident-details {
    border-left: 2px solid var(--border);
    padding-left: 1.25rem;
    margin-left: 0.5rem;
}

.incident-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    color: var(--text);
    cursor: pointer;
}

.incident-title:hover {
    text-decoration: underline;
}

.text-incident {
    color: var(--accent);
}

.text-maintenance {
    color: var(--maintenance);
}

.update-block {
    margin-top: 1rem;
}

.update-status {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.update-msg {
    color: var(--text-muted);
    font-size: 0.95rem;
    white-space: pre-wrap;
}

.update-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Footer */
.page-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.rss-footer-link {
    color: var(--text-muted);
    text-decoration: none;
}

.rss-footer-link:hover {
    text-decoration: underline;
}

/* Buttons & Inputs */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-family: var(--font);
    font-size: 0.875rem;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: #00a082;
}

.btn-secondary {
    background: var(--text);
    color: var(--bg);
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--border);
}

.btn-danger {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
}

.btn-danger:hover {
    background: var(--accent);
    color: #fff;
}

.btn-subscribe {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.btn-subscribe:hover {
    border-color: var(--text);
}

.mr-auto {
    margin-right: auto;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Utility */
.hide-when-exported {
    display: none !important;
}

@media (max-width: 600px) {
    .admin-panel {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .control-group {
        flex-wrap: wrap;
    }

    .btn {
        flex: 1;
        text-align: center;
    }
}