/* Klowen Status — design tokens extracted from the Better Stack status page
   (personal-company.betteruptime.com, public_status_pages-4eeef7b0.css). */

:root {
    /* status colors (light mode) */
    --green: #059669;
    --yellow: #d97706;
    --red: #b91c1c;
    --blue: #0369a1;

    /* hero icon variants (brighter set used by the reference hero) */
    --hero-green: #10b981;
    --hero-yellow: #f59e0b;
    --hero-red: #ef4444;
    --hero-blue: #60a5fa;

    /* neutrals */
    --n-900: #0f121a;
    --n-800: #191c24;
    --n-700: #21242d;
    --n-500: #424757;
    --n-400: #585e72;
    --n-300: #70778c;
    --n-200: #8a91a5;
    --n-100: #a7acbb;
    --n-80: #e2e4e9;
    --n-60: #eeeff2;
    --n-40: #f5f5f7;

    /* type scale */
    --fs-hero: 32px;      /* heading-large, 110% */
    --fs-h2: 22px;        /* heading-small, 110% */
    --fs-large: 15px;
    --fs-base: 13px;      /* body, 150% */
    --fs-small: 12px;

    --shadow-small: 0 1px 2px rgba(15, 18, 26, 0.06);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: #ffffff;
    color: var(--n-500);
    font-family: "Inter", "SF Pro Text", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: var(--fs-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 802px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: inherit;
}

/* ---------- Top nav ---------- */

.topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid rgba(226, 228, 233, 0.5);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    white-space: nowrap;
}

.logo-img {
    display: block;
    width: 246px;
    height: 72px;
}

.tabs {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

/* Reference recipe: px-3 py-2 rounded pill; hover and active both use the
   neutral-60 background with neutral-800 text — active is a persistent pill. */
.tab {
    color: var(--n-500);
    text-decoration: none;
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 4px;
    line-height: 1;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.tab:hover {
    color: var(--n-800);
    background: var(--n-60);
}

.tab.active {
    color: var(--n-800);
    background: var(--n-60);
}

/* ---------- Hero (overall status) ---------- */

.hero {
    padding: 48px 0 36px;
    text-align: center;
}

.hero-icon {
    display: inline-block;
}

.hero-allonline {
    color: var(--hero-green);
}

.hero-maintenance {
    color: var(--hero-blue);
}

.hero-degraded {
    color: var(--hero-yellow);
}

.hero-outage {
    color: var(--hero-red);
}

.hero-title {
    margin: 8px 0 0;
    font-size: var(--fs-hero);
    line-height: 1.1;
    font-weight: 700;
    color: var(--n-800);
}

.hero-updated {
    margin: 12px 0 0;
    font-weight: 500;
    color: var(--n-500);
}

/* ---------- Panel (the single card wrapping all services) ---------- */

.panel {
    background: #fff;
    border: 1px solid var(--n-80);
    border-radius: var(--radius);
    box-shadow: var(--shadow-small);
    padding: 12px;
    margin-bottom: 32px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
}

.panel-title {
    font-weight: 500;
    color: var(--n-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--n-60);
    color: var(--n-800);
    font-weight: 500;
    padding: 4px 10px 4px 6px;
    border-radius: 999px;
    white-space: nowrap;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.dot-allonline { background: var(--green); }
.dot-maintenance { background: var(--blue); }
.dot-degraded { background: var(--yellow); }
.dot-outage { background: var(--red); }

/* Per-service block inside the panel, separated by hairlines like the reference. */
.svc {
    margin: 8px -12px 0;
    padding: 12px 12px 4px;
    border-top: 1px solid rgba(226, 228, 233, 0.5);
}

.svc:first-of-type {
    border-top: none;
    margin-top: 0;
}

.svc-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 0 12px;
}

.svc-name {
    color: var(--n-800);
    font-weight: 500;
    text-decoration: none;
}

.svc-name:hover {
    text-decoration: underline;
}

.svc-state {
    font-weight: 500;
    white-space: nowrap;
}

.state-operational { color: var(--green); }
.state-undermaintenance { color: var(--blue); }
.state-degraded { color: var(--yellow); }
.state-outage { color: var(--red); }

/* ---------- 90-day bars (ticks) ---------- */

.uptime-bar {
    display: flex;
    height: 32px;
    margin: 12px 8px 0;
}

.seg {
    flex: 1 1 0;
    min-width: 0;
    margin-right: 1px;
    border-radius: 1px;
}

.seg:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.seg:last-child {
    margin-right: 0;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.seg:hover {
    opacity: 0.6;
}

.seg-operational { background: var(--green); }
.seg-degraded { background: var(--yellow); }
.seg-outage { background: var(--red); }

/* Responsive window like the reference: last 30 days on phones, 60 on small
   screens, all 90 from 802px up. */
.seg-p1 { display: none; }   /* days 90..61 ago */
.seg-p2 { display: none; }   /* days 60..31 ago */

@media (min-width: 540px) {
    .seg-p2 { display: block; }
}

@media (min-width: 802px) {
    .seg-p1 { display: block; }
}

.bar-axis {
    display: flex;
    justify-content: space-between;
    margin: 12px 12px 8px;
    line-height: 1;
    color: var(--n-300);
}

.axis-30 { display: block; }
.axis-60 { display: none; }
.axis-90 { display: none; }

@media (min-width: 540px) {
    .axis-30 { display: none; }
    .axis-60 { display: block; }
}

@media (min-width: 802px) {
    .axis-60 { display: none; }
    .axis-90 { display: block; }
}

/* ---------- Bar tooltip (white card, like the reference) ---------- */

.bar-tip {
    position: absolute;
    background: #fff;
    border: 1px solid var(--n-80);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(15, 18, 26, 0.12);
    padding: 8px;
    min-width: 150px;
    max-width: 280px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.08s ease-in;
    z-index: 50;
}

.bar-tip.visible {
    opacity: 1;
}

.bar-tip-status {
    padding: 2px 4px 6px;
    font-weight: 500;
    color: var(--n-800);
}

.bar-tip-divider {
    border-top: 1px solid var(--n-80);
    margin: 0 0 6px;
}

.bar-tip-date {
    text-align: center;
    font-size: var(--fs-small);
    color: var(--n-500);
    padding-bottom: 2px;
}

/* ---------- Section headings ---------- */

.section-title {
    font-size: var(--fs-large);
    font-weight: 600;
    color: var(--n-800);
    margin: 32px 0 12px;
}

/* ---------- Event cards (incidents & maintenance) ---------- */

.card {
    background: #fff;
    border: 1px solid var(--n-80);
    border-radius: var(--radius);
    box-shadow: var(--shadow-small);
    padding: 16px 20px;
    margin-bottom: 16px;
}

.event-card {
    border-left: 3px solid var(--n-80);
}

.event-card.impact-degraded {
    border-left-color: var(--yellow);
}

.event-card.impact-outage {
    border-left-color: var(--red);
}

.event-card.maint {
    border-left-color: var(--blue);
}

.event-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.event-title {
    margin: 0;
    font-size: var(--fs-large);
    font-weight: 600;
    color: var(--n-800);
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.event-impact {
    font-size: var(--fs-small);
    font-weight: 600;
    color: var(--n-300);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.event-window {
    margin: 10px 0 0;
    color: var(--n-300);
}

.event-desc {
    margin: 10px 0 0;
    color: var(--n-500);
    white-space: pre-line;
}

.chip {
    background: var(--n-60);
    color: var(--n-500);
    font-size: var(--fs-small);
    font-weight: 500;
    padding: 2px 10px;
    border-radius: 999px;
}

.badge {
    font-size: var(--fs-small);
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.badge-completed {
    background: rgba(5, 150, 105, 0.1);
    color: var(--green);
}

.badge-degraded,
.badge-inprogress {
    background: rgba(217, 119, 6, 0.1);
    color: var(--yellow);
}

.badge-outage {
    background: rgba(185, 28, 28, 0.1);
    color: var(--red);
}

.badge-planned {
    background: rgba(3, 105, 161, 0.1);
    color: var(--blue);
}

.badge-muted {
    background: var(--n-60);
    color: var(--n-400);
}

/* ---------- Timelines ---------- */

.timeline {
    margin-top: 14px;
    border-top: 1px solid rgba(226, 228, 233, 0.7);
    padding-top: 4px;
}

.timeline-entry {
    padding: 12px 0;
    border-bottom: 1px solid rgba(226, 228, 233, 0.7);
}

.timeline-entry:last-child {
    border-bottom: none;
    padding-bottom: 4px;
}

.timeline-status {
    font-weight: 600;
    color: var(--n-800);
}

.timeline-desc {
    margin: 3px 0;
    color: var(--n-500);
    white-space: pre-line;
}

.timeline-time {
    font-size: var(--fs-small);
    color: var(--n-200);
}

/* ---------- History pages ---------- */

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 36px 0 8px;
}

.page-head h1 {
    margin: 0;
    font-size: var(--fs-h2);
    line-height: 1.1;
    font-weight: 700;
    color: var(--n-800);
}

.pager {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--n-80);
    border-radius: 6px;
    background: #fff;
    color: var(--n-800);
    text-decoration: none;
    font-size: 15px;
    line-height: 1;
}

.pager-btn:hover {
    background: var(--n-40);
}

.pager-btn.disabled {
    opacity: 0.35;
    pointer-events: none;
}

.pager-label {
    font-weight: 600;
    color: var(--n-500);
    white-space: nowrap;
}

.month-title {
    font-size: var(--fs-large);
    font-weight: 600;
    color: var(--n-800);
    margin: 32px 0 12px;
}

.day-title {
    font-weight: 500;
    color: var(--n-300);
    margin: 20px 0 10px;
}

.empty {
    color: var(--n-200);
    margin: 8px 0 20px;
}

/* ---------- Footer ---------- */

.site-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
    font-size: var(--fs-small);
    font-weight: 500;
    color: var(--n-300);
}

/* ---------- Admin ---------- */

.admin-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    color: var(--n-500);
}

.admin-bar a {
    color: var(--n-800);
}

.admin-bar .actions {
    display: flex;
    gap: 8px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--n-800);
    margin-bottom: 5px;
}

.form-group .hint,
.hint {
    font-size: var(--fs-small);
    color: var(--n-200);
    margin-top: 6px;
}

input[type="text"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--n-80);
    border-radius: 6px;
    font-size: var(--fs-base);
    font-family: inherit;
    color: var(--n-800);
    background: #fff;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(3, 105, 161, 0.35);
    outline-offset: 0;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.checkbox-row {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.checkbox-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    color: var(--n-500);
    margin: 0;
}

.btn {
    display: inline-block;
    background: var(--n-800);
    color: #fff;
    border: 1px solid var(--n-800);
    border-radius: 6px;
    padding: 8px 14px;
    font-size: var(--fs-base);
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: #fff;
    color: var(--n-800);
    border-color: var(--n-80);
}

.btn-secondary:hover {
    background: var(--n-40);
    opacity: 1;
}

.btn-green {
    background: var(--green);
    border-color: var(--green);
}

.btn-danger {
    background: var(--red);
    border-color: var(--red);
}

.btn-sm {
    padding: 5px 10px;
    font-size: var(--fs-small);
}

.alert-error {
    background: rgba(185, 28, 28, 0.08);
    color: var(--red);
    border: 1px solid rgba(185, 28, 28, 0.25);
    border-radius: 6px;
    padding: 10px 14px;
    margin: 14px 0;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 18px;
}

.field-validation-error {
    display: block;
    color: var(--red);
    font-size: var(--fs-small);
    margin-top: 4px;
}

code {
    background: var(--n-60);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: var(--fs-small);
}

/* ---------- Responsive ---------- */

@media (max-width: 540px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .page-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .event-head {
        flex-direction: column;
        gap: 6px;
    }

    .tabs {
        gap: 2px;
    }

    .tab {
        padding: 8px 8px;
    }
}
