@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css");

:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #090b10;
    color: #f4f7fb;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    background: #090b10;
}

a {
    color: inherit;
}

.site-actions {
    position: fixed;
    top: 1.5rem;
    right: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.site-login {
    color: #c9d5e5;
    font-size: 0.95rem;
    text-decoration: none;
}

.site-login:hover {
    color: #7dd3fc;
}

.home-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 2rem;
    user-select: none;
}

.home-content {
    width: min(100%, 42rem);
    text-align: center;
}

.eyebrow {
    margin: 0 0 1rem;
    color: #7dd3fc;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: 5rem;
    line-height: 1;
    letter-spacing: 0;
}

.subtitle {
    margin: 1.25rem 0 0;
    color: #aab4c3;
    font-size: 1.2rem;
}

.clock {
    margin: 0 0 2.5rem;
}

.clock-time {
    display: block;
    color: #f8fafc;
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 9rem;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 0.95;
    white-space: nowrap;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #b9c5d3;
    font-size: 0.9rem;
}

.site-actions .status {
    font-size: 0.85rem;
}

.status-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 0.25rem rgba(74, 222, 128, 0.12);
}

.calendar {
    width: min(100%, 36rem);
    margin: 0 auto;
    padding-top: 1.75rem;
    border-top: 1px solid #243044;
}

.calendar-title {
    margin: 0 0 1.1rem;
    color: #c9d5e5;
    font-size: 1rem;
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
}

.calendar-weekday {
    padding-bottom: 0.45rem;
    color: #718096;
    font-size: 0.75rem;
    font-weight: 600;
}

.calendar-day {
    display: grid;
    aspect-ratio: 1;
    place-items: center;
    border-radius: 4px;
    color: #c9d5e5;
    font-size: 0.9rem;
}
.interactive-calendar .calendar-day { position: relative; border: 0; background: transparent; cursor: pointer; }
.interactive-calendar .calendar-day:hover, .interactive-calendar .calendar-day-selected { background: #152f46; color: #e0f2fe; }
.interactive-calendar .calendar-day-today { background: #38bdf8; color: #07111a; }
.calendar-event-dot { position: absolute; bottom: 0.25rem; width: 0.28rem; height: 0.28rem; border-radius: 50%; background: #4ade80; }
.home-day-agenda, .home-event-detail { display: grid; gap: 0.45rem; margin-top: 1rem; padding: 0.8rem; border: 1px solid #334155; border-radius: 4px; background: #111722; }
.home-day-agenda small, .home-event-detail small { color: #8e9aaa; font-size: 0.75rem; }
.home-event { display: flex; gap: 0.6rem; width: 100%; border: 0; padding: 0.35rem 0; background: transparent; color: #dceefb; font-size: 0.8rem; text-align: left; cursor: pointer; }
.home-event span { color: #7dd3fc; min-width: 2.8rem; }
.home-event-detail p { margin: 0; color: #aab4c3; font-size: 0.8rem; }

.calendar-day-today {
    background: #38bdf8;
    color: #07111a;
    font-weight: 800;
}

.account-shell {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    min-height: 100vh;
    padding: 0;
}

.account-container {
    width: min(100%, 62rem);
    margin: 0 auto;
}

.app-navigation {
    display: flex;
    position: sticky;
    top: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    height: 100vh;
    padding: 2rem 1.25rem;
    border-right: 1px solid #243044;
    color: #c9d5e5;
}

.app-navigation a {
    text-decoration: none;
}

.app-navigation a:hover {
    color: #7dd3fc;
}

.app-brand {
    margin-bottom: 2rem;
    color: #f4f7fb;
}

.app-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 2rem;
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
    color: #aab4c3;
    font-size: 0.9rem;
}

.app-nav-link i { width: 1rem; color: #7dd3fc; text-align: center; font-size: 0.9rem; }
.app-nav-link:hover { background: #111722; }

.app-nav-category {
    width: 100%;
    margin-top: 0.85rem;
    color: #aab4c3;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.app-nav-sublink {
    padding-left: 1rem;
}

.logout-form {
    margin-top: auto;
}

.sidebar-logout {
    width: 100%;
    min-height: 2.25rem;
    border: 1px solid #334155;
    border-radius: 4px;
    background: transparent;
    color: #c9d5e5;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    padding: 0 0.7rem;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-align: left;
}

.sidebar-logout:hover {
    border-color: #7dd3fc;
    color: #7dd3fc;
}

.account-main {
    min-width: 0;
    padding: 3rem;
}

.account-home {
    width: min(100%, 48rem);
    margin-top: 12vh;
}

.account-panel {
    width: min(100%, 28rem);
    margin: 12vh auto 0;
}

.account-panel h1,
.users-header h1 {
    font-size: 2.25rem;
}

.account-copy {
    color: #aab4c3;
}

.form-stack {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.5rem;
}

.form-field {
    display: grid;
    gap: 0.45rem;
    color: #c9d5e5;
    font-size: 0.9rem;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 2.45rem;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 0.65rem 0.75rem;
    background: #111722;
    color: #f4f7fb;
    font: inherit;
}

.form-field textarea {
    min-height: 16rem;
    resize: vertical;
}

.checkbox-field {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    color: #c9d5e5;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    border: 0;
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    background: #38bdf8;
    color: #07111a;
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    gap: 0.45rem;
    text-decoration: none;
}

.button i, .table-action i { font-size: 0.9rem; }

.button:hover {
    background: #7dd3fc;
}

.notice {
    margin-top: 1rem;
    color: #86efac;
}

.validation-summary-errors,
.field-validation-error {
    color: #fda4af;
    font-size: 0.9rem;
}

.users-header {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 1.75rem;
}

.users-page-header {
    width: min(100%, 72rem);
}

.users-grid {
    width: min(100%, 72rem);
}

.users-table {
    width: 100%;
    overflow: hidden;
    border: 1px solid #243044;
    border-radius: 6px;
    border-collapse: separate;
    border-spacing: 0;
    background: #0d121b;
}

.users-table th,
.users-table td {
    border-bottom: 1px solid #243044;
    padding: 0.75rem 0.8rem;
    text-align: left;
}

.users-table th {
    background: #111722;
    color: #8e9aaa;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
}

.users-table tbody tr:last-child td { border-bottom: 0; }
.users-table tbody tr:hover { background: #111722; }

.text-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: #7dd3fc;
    cursor: pointer;
    text-decoration: none;
}

.table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    color: #7dd3fc;
    font-size: 0.8rem;
    gap: 0.35rem;
    text-decoration: none;
}

.table-action:hover {
    border-color: #7dd3fc;
    background: #111722;
}

.modal-backdrop {
    position: fixed;
    z-index: 10;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(3, 6, 11, 0.78);
}

.modal {
    width: min(96vw, 46rem);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 1.5rem;
    background: #111722;
}

.modal h2 {
    margin: 0;
    font-size: 1.5rem;
}

.password-change-form {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #334155;
}

.module-permissions {
    display: grid;
    gap: 0.7rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #334155;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.notes-filter {
    display: grid;
    grid-template-columns: minmax(12rem, 1.5fr) minmax(10rem, 1fr) minmax(10rem, 1fr) auto auto;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
}

.notes-filter input,
.notes-filter select {
    min-height: 2.5rem;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 0.5rem 0.7rem;
    background: #111722;
    color: #f4f7fb;
    font: inherit;
}

.note-title-link { display: inline-flex; align-items: center; gap: 0.5rem; color: #f4f7fb; font-weight: 700; text-decoration: none; }
.note-title-link i { color: #7dd3fc; font-size: 0.9rem; }
.note-title-link:hover { color: #7dd3fc; }
.notes-table .note-row { cursor: pointer; }
.notes-table .note-row:hover,
.notes-table .note-row:focus { background: #111722; outline: 1px solid #38bdf8; outline-offset: -1px; }
.note-type-badge { display: inline-flex; align-items: center; min-height: 1.55rem; border: 1px solid #334155; border-radius: 3px; padding: 0.08rem 0.4rem; color: #7dd3fc; font-size: 0.75rem; font-weight: 700; }
.note-view-modal { width: min(96vw, 72rem); }
.note-view-code, .note-view-plain { max-height: 55vh; overflow: auto; margin: 1.5rem 0; border: 1px solid #334155; border-radius: 4px; padding: 1.25rem; background: #080b10; color: #dce7f5; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-view-code { font-family: "Cascadia Code", Consolas, monospace; font-size: 0.9rem; line-height: 1.55; }
.note-view-plain { min-height: 14rem; line-height: 1.65; }
.token-keyword { color: #7dd3fc; font-weight: 700; }
.token-string { color: #86efac; }
.token-comment { color: #7d8da2; font-style: italic; }
.token-variable { color: #fbbf24; }
.token-key { color: #c4b5fd; }
.token-literal { color: #fda4af; }

.alert-channel-group { width: min(100%, 72rem); }
.alert-channel-group + .alert-channel-group { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid #263344; }
.calendar-agenda { width: min(100%, 72rem); margin-top: 2rem; }
.calendar-agenda h2 { margin: 0; font-size: 1rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.65rem; }
.calendar-event { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 1rem; border: 1px solid #263344; border-left: 3px solid #38bdf8; border-radius: 4px; padding: 0.7rem 0.85rem; background: #111722; }
.calendar-event + .calendar-event { margin-top: 0.45rem; }
.calendar-event time { color: #8e9aaa; font-size: 0.8rem; }
.calendar-event strong, .calendar-event small { display: block; }
.calendar-event small { margin-top: 0.2rem; color: #7dd3fc; font-size: 0.74rem; }
.calendar-event p { margin: 0.45rem 0 0; color: #aab4c3; font-size: 0.84rem; }
.share-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem; margin-top: 0.35rem; }
.share-selected { display: none; }
.share-selected:not(:empty) { display: block; min-height: 2.3rem; margin-top: 0.55rem; }
.field-hint { margin: 0.45rem 0 0; color: #8e9aaa; font-size: 0.75rem; }
.alert-channel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; padding: 1rem; border: 1px solid #334155; border-radius: 4px; background: #111722; }
.alert-channel-heading > div { margin-right: auto; }
.alert-channel-heading .eyebrow { margin-bottom: 0.3rem; }
.alert-channel-heading .account-copy { margin: 0; font-size: 0.85rem; }
.alert-type-icon { display: grid; flex: 0 0 2.5rem; width: 2.5rem; height: 2.5rem; place-items: center; border: 1px solid #334155; border-radius: 4px; background: #0d1a29; color: #7dd3fc; font-size: 1rem; }
.alert-type-icon-small { flex-basis: 2rem; width: 2rem; height: 2rem; font-size: 0.85rem; }
.alert-channel-count { color: #aab4c3; font-size: 0.78rem; white-space: nowrap; }
.alert-channel-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.75rem; }
.alert-channel-card { display: flex; align-items: center; gap: 0.75rem; min-height: 4.25rem; border: 1px solid #334155; border-radius: 4px; padding: 0.75rem; background: #111722; color: #f4f7fb; text-decoration: none; }
.alert-channel-card:hover { border-color: #7dd3fc; background: #152033; }
.alert-channel-card strong, .alert-channel-card small { display: block; }
.alert-channel-card small { margin-top: 0.2rem; color: #aab4c3; font-size: 0.78rem; }
.alert-channel-arrow { margin-left: auto; color: #7dd3fc; font-size: 1.5rem; }

.modal-wide {
    width: min(96vw, 64rem);
}

.modal-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem;
}

.modal-form-grid .form-field-full {
    grid-column: 1 / -1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.monitor-toolbar {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) minmax(14rem, 28rem) auto;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid #243044;
    border-radius: 4px;
    padding: 1rem;
    background: #111722;
}

.monitor-toolbar .eyebrow { margin-bottom: 0.3rem; }
.monitor-toolbar h1 { margin: 0; font-size: 1.45rem; }
.monitor-search input {
    width: 100%;
    min-height: 2.25rem;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 0.45rem 0.7rem;
    background: #0b1018;
    color: #f4f7fb;
    font: inherit;
    font-size: 0.85rem;
}
.monitor-toolbar-actions { display: flex; align-items: center; gap: 0.55rem; }
.monitor-summary { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 1rem 0; }
.monitor-summary a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2rem;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 0.25rem 0.6rem;
    background: #111722;
    color: #aab4c3;
    font-size: 0.78rem;
    text-decoration: none;
}
.monitor-summary a strong { color: #f4f7fb; }
.monitor-summary a:hover, .monitor-summary a.active { border-color: #38bdf8; background: #11304a; color: #dceefb; }
.monitor-groups { display: grid; gap: 1.25rem; }
.monitor-group-heading { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.45rem; }
.monitor-group-heading h2 { margin: 0; color: #dce7f5; font-size: 0.95rem; }
.monitor-group-heading span { color: #8e9aaa; font-size: 0.75rem; }
.monitor-list { display: grid; gap: 0.45rem; }
.monitor-card {
    display: grid;
    grid-template-columns: 2.3rem minmax(12rem, 2fr) minmax(5rem, 0.8fr) minmax(7rem, 0.9fr) minmax(6rem, 0.8fr) 4.7rem;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.8rem;
    border: 1px solid #243044;
    border-left: 3px solid #64748b;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    background: #111722;
    color: #f4f7fb;
    text-decoration: none;
}
.monitor-card:hover { border-color: #38bdf8; background: #152033; }
.monitor-card.up { border-left-color: #22c55e; }
.monitor-card.down { border-left-color: #f43f5e; }
.monitor-card.pending { border-left-color: #fbbf24; }
.monitor-card.paused { border-left-color: #64748b; }
.monitor-type-icon { display: grid; width: 2.1rem; height: 2.1rem; place-items: center; border: 1px solid #334155; border-radius: 4px; background: #0d1a29; color: #7dd3fc; }
.monitor-type-icon i { font-size: 0.95rem; }
.monitor-identity, .monitor-metric { display: grid; gap: 0.16rem; min-width: 0; }
.monitor-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.87rem; }
.monitor-identity small { overflow: hidden; color: #8e9aaa; font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.monitor-metric small { color: #6f8199; font-size: 0.62rem; font-weight: 700; }
.monitor-metric strong { color: #dce7f5; font-size: 0.76rem; }
.monitor-empty { margin: 2rem 0; color: #8e9aaa; font-size: 0.9rem; }

.monitor-status {
    display: inline-flex;
    min-width: 4.5rem;
    justify-content: center;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.monitor-status.up { background: #123827; color: #86efac; }
.monitor-status.down { background: #481923; color: #fda4af; }
.monitor-status.pending { background: #3f3214; color: #fde68a; }
.monitor-status.paused { background: #263142; color: #c9d5e5; }

.monitor-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin: 1.5rem 0;
    border: 1px solid #334155;
    background: #334155;
}

.monitor-detail-grid > div {
    display: grid;
    gap: 0.45rem;
    min-height: 4.5rem;
    padding: 0.85rem;
    background: #111722;
}

.monitor-detail-grid span { color: #8e9aaa; font-size: 0.7rem; font-weight: 700; }
.monitor-detail-grid strong { font-size: 0.9rem; overflow-wrap: anywhere; }
.history-panel, .configuration-panel { margin: 1.5rem 0; padding: 1rem; border: 1px solid #334155; border-radius: 4px; }
.history-ticks { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 0.25rem; }
.history-ticks span { height: 1.25rem; border-radius: 2px; background: #263142; }
.history-ticks .history-success { background: #22c55e; }
.history-ticks .history-failed { background: #f43f5e; }

@media (max-width: 50rem) {
    .monitor-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .monitor-toolbar { grid-template-columns: 1fr auto; }
    .monitor-search { grid-column: 1 / -1; grid-row: 2; }
    .monitor-card { grid-template-columns: 2.3rem minmax(0, 1fr) auto; }
    .monitor-metric { display: none; }
}

.modal-close {
    color: #c9d5e5;
    font-size: 2rem;
    line-height: 1;
    text-decoration: none;
}

@media (max-width: 32rem) {
    .home-shell {
        padding: 1.5rem;
    }

    .site-actions {
        top: 1rem;
        right: 1.25rem;
        gap: 0.85rem;
    }

    .account-shell {
        display: block;
        padding: 1.5rem;
    }

    .app-navigation {
        position: static;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 1rem;
        height: auto;
        margin-bottom: 2.5rem;
        padding: 0 0 1rem;
        border-right: 0;
        border-bottom: 1px solid #243044;
    }

    .app-brand {
        width: auto;
        margin: 0 1rem 0 0;
    }

    .logout-form {
        margin: 0 0 0 auto;
    }

    .account-main {
        padding: 0;
    }

    h1 {
        font-size: 3rem;
    }

    .clock-time {
        font-size: 3.5rem;
    }

    .modal {
        width: 100%;
        padding: 1.25rem;
    }

    .modal-form-grid {
        grid-template-columns: 1fr;
    }

    .modal-form-grid .form-field-full {
        grid-column: auto;
    }

    .notes-filter { grid-template-columns: 1fr; }

}

@media (min-width: 33rem) and (max-width: 60rem) {
    h1 {
        font-size: 4rem;
    }

    .clock-time {
        font-size: 6.5rem;
    }
}
