:root {
    --ink: #101a3d;
    --muted: #586681;
    --blue: #275fe8;
    --line: #dce2ed;
    --soft: #f5f7fb;
    --green: #157443;
    --red: #b42a38;
    --radius: 8px;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: #f0f3f8;
    font-size: 15px;
    line-height: 1.5;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
}
button,
input,
select,
textarea {
    font: inherit;
}
a {
    color: var(--blue);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
button,
a,
input,
select,
textarea {
    touch-action: manipulation;
}
button {
    cursor: pointer;
}
button:disabled {
    cursor: wait;
    opacity: 0.6;
}
:focus-visible {
    outline: 3px solid #9bbcff;
    outline-offset: 3px;
}
.app {
    display: flex;
    min-height: 100vh;
    background: white;
}
.sidebar {
    width: 220px;
    flex: none;
    border-right: 1px solid var(--line);
    padding: 26px 14px;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: white;
    z-index: 30;
}
.brand {
    display: flex;
    align-items: center;
    padding: 0 10px 28px;
}
.brand:hover {
    text-decoration: none;
}
.brand-logo {
    display: block;
    width: 156px;
    max-width: 100%;
    height: auto;
}
.sidebar nav {
    display: grid;
    gap: 7px;
}
.nav-link {
    color: var(--ink);
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    position: relative;
    font-size: 16px;
}
.nav-link:hover {
    background: var(--soft);
    text-decoration: none;
}
.nav-link.active {
    background: #e7efff;
    color: #064ce4;
    font-weight: 650;
}
.nav-link.active:before {
    position: absolute;
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 3px;
    background: var(--blue);
    content: "";
    border-radius: 3px;
}
.icon {
    width: 20px;
    height: 20px;
    flex: none;
    vertical-align: middle;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sidebar-footer {
    margin-top: auto;
    padding: 18px 12px;
    color: var(--muted);
    font-size: 12px;
}
.workspace {
    margin-left: 220px;
    flex: 1;
    min-width: 0;
}
.topbar {
    height: 66px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 28px;
    gap: 20px;
}
.breadcrumb {
    color: var(--muted);
    font-size: 14px;
}
.user-menu {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 13px;
}
.avatar {
    background: #eaf0ff;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    border-radius: 50%;
    color: #2558d8;
    font-weight: 600;
}
.user-name {
    font-weight: 650;
}
.muted {
    color: var(--muted);
}
.small {
    font-size: 13px;
}
.mobile-toggle {
    display: none;
}
.content {
    max-width: 1600px;
    padding: 28px 28px 60px;
    margin: auto;
}
.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 22px;
    margin-bottom: 22px;
}
h1 {
    font-size: 32px;
    line-height: 1.25;
    letter-spacing: -1px;
    margin: 0 0 7px;
    font-weight: 750;
}
h2 {
    font-size: 22px;
    line-height: 1.3;
    letter-spacing: -0.5px;
    margin: 0 0 18px;
}
h3 {
    font-size: 17px;
    margin: 0 0 15px;
}
.subtitle {
    font-size: 16px;
    color: var(--muted);
    margin: 0;
}
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    color: var(--ink);
    font-weight: 600;
    font-size: 14px;
    min-height: 42px;
    white-space: nowrap;
}
.btn:hover {
    background: #f3f6fc;
    text-decoration: none;
}
.btn.primary {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}
.btn.primary:hover {
    background: #174ed1;
}
.btn.danger {
    border-color: #f0b9bf;
    color: var(--red);
}
.btn.small {
    min-height: 34px;
    padding: 6px 11px;
    font-size: 12px;
}
.btn.link {
    border: 0;
    background: none;
    padding: 6px;
    color: var(--muted);
}
.btn.block {
    width: 100%;
}
.actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.tabs {
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 24px;
    margin-bottom: 26px;
}
.tab {
    border: 0;
    background: transparent;
    padding: 12px 16px;
    color: var(--muted);
    font-size: 16px;
    border-bottom: 3px solid transparent;
}
.tab.active {
    color: var(--blue);
    font-weight: 650;
    border-color: var(--blue);
}
[hidden] {
    display: none !important;
}
.event-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 22px;
    align-items: start;
}
.metrics {
    display: flex;
    gap: 0;
    margin: 5px 0 23px;
    padding: 4px 0 26px;
    border-bottom: 1px solid var(--line);
}
.metric {
    flex: 1;
    padding: 0 24px;
    border-right: 1px solid #cbd5e6;
}
.metric:first-child {
    padding-left: 0;
}
.metric:last-child {
    border: 0;
}
.metric strong {
    display: block;
    font-size: 36px;
    line-height: 1.2;
    letter-spacing: -1px;
}
.metric span {
    font-size: 15px;
    color: var(--muted);
}
.toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.searchbox {
    position: relative;
    flex: 1;
    min-width: 190px;
}
.searchbox .icon {
    position: absolute;
    left: 12px;
    top: 12px;
    color: var(--muted);
}
.searchbox input {
    padding-left: 40px;
    width: 100%;
}
.toolbar select {
    max-width: 220px;
}
input,
select,
textarea {
    border: 1px solid #cbd3e3;
    border-radius: 6px;
    padding: 10px 12px;
    background: white;
    color: var(--ink);
    min-width: 0;
}
input::placeholder,
textarea::placeholder {
    color: #64718a;
}
input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--blue);
    flex: none;
}
textarea {
    resize: vertical;
    min-height: 100px;
}
.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 18px;
}
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}
th {
    background: var(--soft);
    font-size: 12px;
    white-space: nowrap;
    font-weight: 650;
    color: #26314e;
    padding: 13px 14px;
}
td {
    padding: 15px 14px;
    border-top: 1px solid var(--line);
    vertical-align: middle;
}
tbody tr:hover {
    background: #fbfcff;
}
.person {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 195px;
}
.person strong {
    display: block;
    font-size: 13px;
}
.person .small {
    font-size: 12px;
    white-space: nowrap;
}
.coverage {
    display: inline-block;
    padding: 3px 8px;
    background: #e8f0ff;
    color: #1543ae;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}
.coverage.complete {
    background: #def7e7;
    color: #145a34;
}
.status {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    font-size: 13px;
    color: var(--muted);
}
.dot {
    width: 8px;
    height: 8px;
    background: #158344;
    border-radius: 50%;
    display: inline-block;
    flex: none;
}
.status.offline .dot {
    background: var(--red);
}
.qr-panel {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px;
    scroll-margin-top: 20px;
}
.qr-panel h2 {
    font-size: 20px;
    margin-bottom: 18px;
}
.qr-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
}
.qr-panel p {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    margin: 12px 0 20px;
}
.qr-panel .btn {
    margin-bottom: 10px;
}
.qr-panel .connection {
    margin-top: 20px;
}
.panel {
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 23px;
    margin-bottom: 22px;
}
.panel.flat {
    border: 0;
    padding: 0;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}
.field label {
    font-weight: 600;
    font-size: 13px;
}
.field small {
    color: var(--muted);
    font-size: 12px;
}
.field input,
.field select,
.field textarea {
    width: 100%;
}
.span-all {
    grid-column: 1/-1;
}
.form-limit {
    max-width: 900px;
}
.form-narrow {
    max-width: 600px;
}
.alert {
    padding: 14px 17px;
    border-radius: 7px;
    border: 1px solid #c8e6d5;
    background: #f0faf4;
    color: #1c603a;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert.error {
    background: #fff5f5;
    border-color: #edc6ca;
    color: #9a2634;
}
.alert ul {
    margin: 5px 0 0;
    padding-left: 18px;
}
.empty {
    text-align: center;
    padding: 42px 22px;
    color: var(--muted);
}
.empty strong {
    display: block;
    color: var(--ink);
    font-size: 17px;
    margin-bottom: 6px;
}
.empty .btn {
    margin-top: 15px;
}
.help {
    background: #f6f8fd;
    padding: 14px 17px;
    border-left: 3px solid #b9cdfa;
    color: var(--muted);
    font-size: 13px;
    margin: 15px 0 22px;
}
.definition {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 14px;
    margin: 0;
}
.definition dt {
    color: var(--muted);
}
.definition dd {
    margin: 0;
}
.prose {
    white-space: pre-wrap;
    color: var(--muted);
    line-height: 1.7;
}
.day-row {
    display: grid;
    grid-template-columns: 1.3fr repeat(4, 1fr) 1fr auto;
    gap: 9px;
    align-items: end;
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
}
.day-row .field {
    margin-bottom: 0;
}
.day-row input,
.day-row select {
    padding: 9px 7px;
    font-size: 13px;
}
.day-row label {
    font-size: 11px;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    margin: 10px 0;
}
.pagination {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
    margin-top: 20px;
}
.pagination .actions {
    gap: 5px;
}
.auth-body,
.public-body {
    min-height: 100vh;
    padding: 40px 18px;
    background: #f3f6fb;
}
.auth-brand {
    display: flex;
    justify-content: center;
    margin: 0 auto 26px;
}
.auth-brand .brand {
    padding: 0;
}
.auth-brand .brand-logo {
    width: 172px;
}
.auth-panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 30px;
    max-width: 430px;
    margin: 0 auto;
    box-shadow: 0 8px 30px #17274b07;
}
.auth-panel h1 {
    font-size: 26px;
    letter-spacing: -0.7px;
}
.auth-panel .subtitle {
    font-size: 14px;
    margin-bottom: 24px;
}
.auth-panel .field {
    margin-bottom: 17px;
}
.public-panel {
    max-width: 560px;
}
.public-panel h1 {
    font-size: 26px;
}
.public-event-meta {
    border-bottom: 1px solid var(--line);
    padding-bottom: 20px;
    margin-bottom: 23px;
}
.public-panel .btn {
    margin-top: 8px;
}
.public-footer {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    margin: 20px auto;
    max-width: 500px;
}
.badge {
    padding: 3px 9px;
    background: #edf1f8;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
}
.badge.open {
    background: #e4f6ea;
    color: #176440;
}
.badge.cancelled,
.badge.closed {
    background: #fbe9eb;
    color: #a12533;
}
.audit-row {
    border-top: 1px solid var(--line);
    padding: 12px 0;
    font-size: 13px;
}
.review {
    font-size: 11px;
    color: #9c5c00;
    display: block;
}
.split {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
    gap: 24px;
}
.preview {
    white-space: pre-wrap;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 16px;
    font-size: 13px;
    max-height: 260px;
    overflow: auto;
}
.required {
    color: var(--red);
}
.error-page {
    max-width: 650px;
    margin: 12vh auto;
    padding: 30px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
@media (min-width: 1450px) {
    .event-grid {
        grid-template-columns: minmax(0, 1fr) 280px;
    }
    .content {
        padding: 34px 32px;
    }
    .person {
        min-width: 215px;
    }
    td {
        padding: 17px 15px;
    }
}
@media (max-width: 1120px) {
    .sidebar {
        width: 195px;
    }
    .workspace {
        margin-left: 195px;
    }
    .brand-logo {
        width: 140px;
    }
    .content {
        padding: 24px 20px;
    }
    .event-grid {
        grid-template-columns: minmax(0, 1fr) 235px;
        gap: 17px;
    }
    .metric {
        padding: 0 15px;
    }
    .metric span {
        font-size: 13px;
    }
    .metric strong {
        font-size: 31px;
    }
    .qr-panel {
        padding: 16px;
    }
    .qr-panel h2 {
        font-size: 18px;
    }
    .day-row {
        grid-template-columns: repeat(3, 1fr);
    }
    .split {
        grid-template-columns: 1fr;
    }
    .toolbar .searchbox {
        flex-basis: 100%;
    }
}
@media (max-width: 850px) {
    .event-grid {
        grid-template-columns: 1fr;
    }
    .qr-panel {
        max-width: 360px;
    }
    .qr-image {
        max-width: 235px;
        margin: auto;
    }
    .form-grid {
        gap: 12px;
    }
    .topbar {
        padding: 0 20px;
    }
    .user-name {
        display: none;
    }
    .tabs {
        gap: 10px;
    }
    .tab {
        padding: 11px 10px;
    }
    .page-heading h1 {
        font-size: 28px;
    }
}
@media (max-width: 640px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.18s;
        width: 220px;
        box-shadow: 8px 0 25px #12234512;
    }
    .sidebar.is-open {
        transform: translateX(0);
    }
    .workspace {
        margin-left: 0;
    }
    .mobile-toggle {
        display: inline-flex;
    }
    .topbar {
        height: 58px;
        padding: 0 16px;
        gap: 10px;
    }
    .breadcrumb {
        margin-right: auto;
    }
    .content {
        padding: 23px 16px 40px;
    }
    .page-heading {
        flex-wrap: wrap;
        gap: 14px;
        margin-bottom: 19px;
    }
    .page-heading h1 {
        font-size: 27px;
        letter-spacing: -0.7px;
    }
    .subtitle {
        font-size: 14px;
    }
    .page-heading .actions {
        width: 100%;
    }
    .metric {
        padding: 0 10px;
    }
    .metric strong {
        font-size: 29px;
    }
    .metric span {
        font-size: 12px;
    }
    .metrics {
        padding-bottom: 20px;
    }
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .panel {
        padding: 18px;
    }
    .day-row {
        grid-template-columns: 1fr 1fr;
        padding: 16px 0;
        gap: 12px;
    }
    .day-row .field label {
        font-size: 12px;
    }
    .day-row .btn {
        justify-self: start;
    }
    .toolbar {
        gap: 8px;
    }
    .toolbar select {
        flex: 1;
        max-width: none;
    }
    .toolbar .btn {
        padding: 10px 12px;
    }
    .auth-body,
    .public-body {
        padding: 24px 14px;
    }
    .auth-panel {
        padding: 23px 21px;
    }
    .auth-panel h1 {
        font-size: 25px;
    }
    .auth-brand {
        margin-bottom: 22px;
    }
    .user-menu .avatar {
        display: none;
    }
    .definition {
        grid-template-columns: 110px 1fr;
        font-size: 14px;
    }
    .pagination {
        align-items: flex-start;
        flex-direction: column;
    }
    .table-wrap table {
        min-width: 650px;
    }
    .table-wrap.compact table {
        min-width: 520px;
    }
    .split {
        gap: 15px;
    }
    .qr-panel {
        max-width: none;
    }
    .preview {
        font-size: 12px;
    }
}
.sidebar-close {
    display: none;
}
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: #101a3d40;
    border: 0;
    width: 100%;
    height: 100%;
}
@media (max-width: 640px) {
    .sidebar-close {
        display: inline-flex;
        margin-bottom: 18px;
    }
}
.btn.mobile-toggle {
    display: none;
}
.person strong {
    font-size: 14px;
}
.person strong a {
    color: var(--ink);
}
table {
    font-size: 14px;
}
th {
    font-size: 13px;
}
.event-grid > * {
    min-width: 0;
}
.sidebar {
    top: 0;
    left: 0;
}
.breadcrumb {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.table-wrap {
    position: relative;
}
.sr-only {
    left: 0;
    top: 0;
}
@media (max-width: 640px) {
    .btn.mobile-toggle {
        display: inline-flex;
    }
}
@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
