:root {
    color-scheme: light;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #20242b;
    background: #f3f4f6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

.welcome {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 2rem;
}

.welcome__card {
    width: min(100%, 42rem);
    padding: 2.5rem;
    border: 1px solid #d9dde5;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 1rem 3rem rgb(32 36 43 / 8%);
}

.welcome__status {
    color: #18794e;
    font-weight: 700;
}

button,
input {
    font: inherit;
}

.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1.5rem;
}

.auth-card,
.panel {
    width: min(100%, 30rem);
    padding: 2rem;
    border: 1px solid #d9dde5;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 1rem 3rem rgb(32 36 43 / 8%);
}

.auth-card h1,
.panel h1 {
    margin: 0.25rem 0 0.5rem;
}

.eyebrow {
    margin: 0;
    color: #315bd5;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.muted {
    color: #646b78;
}

.auth-card > label:not(.checkbox) {
    display: block;
    margin: 1rem 0 0.4rem;
    font-weight: 650;
}

.auth-card input[type="email"],
.auth-card input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #adb4c0;
    border-radius: 0.4rem;
}

.auth-card input:focus {
    border-color: #315bd5;
    outline: 3px solid rgb(49 91 213 / 16%);
}

.checkbox {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 1rem 0;
}

button {
    padding: 0.7rem 1rem;
    border: 1px solid #315bd5;
    border-radius: 0.4rem;
    color: #fff;
    background: #315bd5;
    cursor: pointer;
}

.auth-card button {
    width: 100%;
}

.button-secondary {
    color: #20242b;
    border-color: #adb4c0;
    background: #fff;
}

.alert {
    margin: 1rem 0;
    padding: 0.75rem;
    border-radius: 0.4rem;
    color: #8b1e24;
    background: #ffebed;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid #d9dde5;
    background: #fff;
}

.content {
    padding: 2rem;
}

.panel {
    width: min(100%, 48rem);
    margin: 3rem auto;
}

a {
    color: inherit;
}

.content-wide {
    width: min(100%, 80rem);
    margin: 0 auto;
}

.topbar__actions,
.page-heading,
.section-heading,
.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.topbar__actions {
    font-size: 0.9rem;
}

.page-heading {
    margin-bottom: 1.5rem;
}

.page-heading h1 {
    margin: 0.25rem 0 0;
}

.button-link {
    display: inline-block;
    padding: 0.7rem 1rem;
    border: 1px solid #315bd5;
    border-radius: 0.4rem;
    color: #fff;
    background: #315bd5;
    font-weight: 650;
    text-decoration: none;
}

.button-link-secondary {
    color: #20242b;
    border-color: #adb4c0;
    background: #fff;
}

.text-link {
    color: #315bd5;
    font-weight: 650;
    text-decoration: none;
}

.table-card,
.form-card {
    overflow: hidden;
    margin-bottom: 1.25rem;
    padding: 1.5rem;
    border: 1px solid #d9dde5;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 0.5rem 2rem rgb(32 36 43 / 5%);
}

.table-card {
    padding: 0;
}

.table-card table {
    width: 100%;
    border-collapse: collapse;
}

.table-card th,
.table-card td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.table-card th {
    color: #646b78;
    background: #f8f9fb;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.table-card small {
    color: #646b78;
}

.row-actions {
    display: flex;
    min-width: 14rem;
    flex-wrap: wrap;
    gap: 0.55rem 0.8rem;
    align-items: center;
}

.row-actions form {
    margin: 0;
}

.action-link,
.action-button {
    padding: 0;
    border: 0;
    color: #315bd5;
    background: transparent;
    font-size: 0.83rem;
    font-weight: 650;
    text-decoration: none;
}

.action-button-danger {
    color: #a5222b;
}

.preview-links {
    display: flex;
    gap: 0.45rem;
    padding-left: 0.8rem;
    border-left: 1px solid #d9dde5;
}

.empty-state {
    padding: 3rem;
    text-align: center;
}

.success-message {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.4rem;
    color: #12613d;
    background: #e5f7ee;
}

.validation-summary ul {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

.form-card h2 {
    margin-top: 0;
}

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

.field-wide {
    grid-column: 1 / -1;
}

.field label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 650;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #adb4c0;
    border-radius: 0.4rem;
    color: #20242b;
    background: #fff;
    font: inherit;
}

.field textarea {
    resize: vertical;
    line-height: 1.55;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: #315bd5;
    outline: 3px solid rgb(49 91 213 / 16%);
}

.field-note {
    margin: 0.4rem 0 0;
    color: #646b78;
    font-size: 0.82rem;
}

.coordinate-grid {
    margin-bottom: 1rem;
}

.event-map {
    z-index: 0;
    width: 100%;
    height: 28rem;
    border: 1px solid #d9dde5;
    border-radius: 0.5rem;
}

.language-tabs {
    display: flex;
    gap: 0.4rem;
    margin: 1rem 0;
    border-bottom: 1px solid #d9dde5;
}

.language-tab {
    margin-bottom: -1px;
    border-color: transparent;
    border-bottom-color: #d9dde5;
    border-radius: 0.4rem 0.4rem 0 0;
    color: #646b78;
    background: transparent;
}

.language-tab.is-active {
    border-color: #d9dde5;
    border-bottom-color: #fff;
    color: #315bd5;
    background: #fff;
}

.language-panel {
    min-width: 0;
    padding: 0;
    border: 0;
}

.language-panel .field + .field {
    margin-top: 1rem;
}

.form-actions {
    margin: 1.5rem 0 3rem;
}

.form-actions > div {
    display: flex;
    gap: 0.75rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.error-message,
.publication-notice {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 0.65rem;
}

.error-message {
    color: #8b1e24;
    border: 1px solid #ffc9ce;
    background: #fff0f1;
}

.publication-notice {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    color: #604b14;
    border: 1px solid #ead898;
    background: #fff9df;
    font-size: 0.88rem;
}

.publication-notice__icon {
    display: grid;
    width: 1.6rem;
    height: 1.6rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #a77c08;
    font-weight: 800;
}

.events-card {
    margin-bottom: 1.25rem;
    border: 1px solid #d9dde5;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 0.5rem 2rem rgb(32 36 43 / 5%);
}

.event-row {
    display: grid;
    grid-template-columns: minmax(22rem, 1fr) 12rem auto;
    gap: 1.25rem;
    align-items: center;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.event-row:last-child {
    border-bottom: 0;
}

.event-row-active {
    box-shadow: inset 4px 0 #e1262f;
    background: #fffbfb;
}

.event-main {
    display: flex;
    min-width: 0;
    gap: 1rem;
    align-items: center;
}

.event-date {
    width: 5.2rem;
    flex: 0 0 auto;
    color: #646b78;
    font-size: 0.78rem;
}

.event-date span,
.event-date strong {
    display: block;
}

.event-date strong {
    margin-top: 0.12rem;
    color: #20242b;
    font-size: 1.25rem;
}

.event-title {
    min-width: 0;
}

.event-title h2 {
    overflow: hidden;
    margin: 0 0 0.4rem;
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.9rem;
    color: #646b78;
    font-size: 0.78rem;
}

.event-status {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.3rem;
}

.event-status small {
    color: #777e89;
    font-size: 0.73rem;
}

.status-badge {
    display: inline-flex;
    gap: 0.38rem;
    align-items: center;
    padding: 0.28rem 0.52rem;
    border-radius: 999px;
    color: #555d69;
    background: #eef0f3;
    font-size: 0.72rem;
    font-weight: 750;
}

.status-ready {
    color: #2452a6;
    background: #eaf0ff;
}

.status-live {
    color: #9c1820;
    background: #ffe6e8;
}

.status-live i {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #d91f29;
    box-shadow: 0 0 0 3px rgb(217 31 41 / 12%);
}

.event-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    align-items: center;
}

.event-actions form {
    margin: 0;
}

.publish-button {
    padding: 0.6rem 0.75rem;
    border-color: #d91f29;
    background: #d91f29;
    font-size: 0.78rem;
    font-weight: 750;
    white-space: nowrap;
}

.disable-mode-button {
    padding: 0.6rem 0.75rem;
    color: #8b1e24;
    border-color: #e4a9ad;
    background: #fff;
    font-size: 0.78rem;
    font-weight: 750;
    white-space: nowrap;
}

.publish-button:disabled,
.disable-mode-button:disabled {
    border-color: #b9bec7;
    color: #fff;
    background: #b9bec7;
    cursor: not-allowed;
}

.action-menu {
    position: relative;
}

.action-menu summary {
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border: 1px solid #cdd2da;
    border-radius: 0.45rem;
    background: #fff;
    cursor: pointer;
    list-style: none;
    font-weight: 800;
}

.action-menu summary::-webkit-details-marker {
    display: none;
}

.action-menu__panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.4rem);
    right: 0;
    width: 14rem;
    padding: 0.45rem;
    border: 1px solid #d9dde5;
    border-radius: 0.55rem;
    background: #fff;
    box-shadow: 0 0.8rem 2.2rem rgb(32 36 43 / 16%);
}

.action-menu__panel > a,
.action-menu__panel > form button {
    display: block;
    width: 100%;
    padding: 0.62rem 0.7rem;
    border: 0;
    border-radius: 0.35rem;
    color: #303640;
    background: transparent;
    font-size: 0.8rem;
    text-align: left;
    text-decoration: none;
}

.action-menu__panel > a:hover,
.action-menu__panel > form button:hover {
    background: #f3f5f8;
}

.action-menu__section {
    margin: 0.3rem 0;
    padding: 0.6rem 0.7rem;
    border-top: 1px solid #edf0f3;
    border-bottom: 1px solid #edf0f3;
}

.action-menu__section > span {
    display: block;
    margin-bottom: 0.45rem;
    color: #777e89;
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.action-menu .preview-links {
    padding: 0;
    border: 0;
}

.action-menu .preview-links a {
    padding: 0.25rem 0.4rem;
    border-radius: 0.3rem;
    color: #315bd5;
    background: #edf2ff;
    font-size: 0.72rem;
    font-weight: 750;
    text-decoration: none;
}

.action-menu__panel .menu-danger {
    color: #a5222b;
}

@media (max-width: 700px) {
    .topbar,
    .content {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .topbar__actions > span {
        display: none;
    }

    .page-heading,
    .section-heading,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

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

    .field-wide {
        grid-column: auto;
    }

    .event-map {
        height: 22rem;
    }

    .language-tabs {
        overflow-x: auto;
    }

    .event-row {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .event-status {
        padding-left: 6.2rem;
    }

    .event-actions {
        justify-content: flex-start;
        padding-left: 6.2rem;
    }
}
