body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: #111;
    background: #fff;
}

.page {
    padding: 20px;
}

.docs-wrapper {
    margin: -20px;
    height: calc(100vh - 120px);
}

.docs-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.site-header {
    background: #000;
    color: #fff;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.brand img {
    height: 36px;
    width: auto;
    display: block;
}

.nav-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1 1 auto;
}

.nav-tabs a {
    color: #fff;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background 0.15s ease-in-out;
}

.nav-tabs a:hover {
    background: #1f1f1f;
}

.nav-tools {
    position: relative;
}

.nav-account {
    margin-left: auto;
}

.nav-tools summary {
    list-style: none;
    cursor: pointer;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
}

.nav-tools summary::-webkit-details-marker {
    display: none;
}

.nav-tools[open] summary,
.nav-tools summary:hover {
    background: #1f1f1f;
}

.nav-tools-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 6px;
    display: grid;
    gap: 4px;
    min-width: 160px;
    z-index: 10;
}

.nav-account .nav-tools-menu {
    right: 0;
    left: auto;
}

.nav-tools-menu form {
    margin: 0;
}

.nav-tools:not([open]) .nav-tools-menu {
    display: none;
}

.nav-tools:hover .nav-tools-menu,
.nav-tools:focus-within .nav-tools-menu {
    display: grid;
}

.nav-tools-menu a {
    color: #fff;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
}

.nav-tools-menu .nav-account-action {
    width: 100%;
    text-align: left;
    color: #fff;
    background: transparent;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font: inherit;
}

.nav-tools-menu a:hover {
    background: #1f1f1f;
}

.nav-tools-menu .nav-account-action:hover {
    background: #1f1f1f;
}

.page-actions {
    margin: 10px 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.event-filters,
.toggle-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: flex-end;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #d6dbee;
    background: #fafbff;
    box-shadow: inset 0 0 0 1px rgba(115, 122, 183, 0.08);
}

.event-filters .filter-group,
.toggle-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}

.event-filters label,
.toggle-filters label {
    font-weight: 600;
    color: #1b1b1b;
}

.event-filters input,
.event-filters select,
.toggle-filters input,
.toggle-filters select {
    border: 1px solid #cfd1e5;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.95em;
    background: #fff;
}

.event-filters input:focus,
.event-filters select:focus,
.toggle-filters input:focus,
.toggle-filters select:focus {
    border-color: #737ab7;
    outline: none;
    box-shadow: 0 0 0 2px rgba(115, 122, 183, 0.2);
}

.event-filters select[multiple],
.toggle-filters select[multiple] {
    min-height: 88px;
}

.event-filters .btn,
.event-filters .toggle-switch,
.toggle-filters .btn,
.toggle-filters .toggle-switch {
    margin-top: 8px;
}

.event-filters .btn,
.toggle-filters .btn {
    min-width: 88px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    line-height: 1;
    padding: 0 12px;
}

.org-filter-dropdown {
    position: relative;
    width: 100%;
}

.org-filter-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 10;
    width: 100%;
    min-width: 220px;
    background: #fff;
    border: 1px solid #cfd1e5;
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(25, 30, 70, 0.12);
    padding: 10px;
}

.org-filter-panel.open {
    display: block;
}

.org-filter-panel input[type="search"] {
    width: 100%;
    margin-bottom: 8px;
}

.org-filter-list {
    max-height: 220px;
    overflow-y: auto;
    display: grid;
    gap: 6px;
}

.equipment-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.equipment-search label {
    font-weight: 600;
}

.equipment-search input {
    border: 1px solid #cfd1e5;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.95em;
    min-width: 220px;
}

.equipment-search input:focus {
    border-color: #737ab7;
    outline: none;
    box-shadow: 0 0 0 2px rgba(115, 122, 183, 0.2);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 24px;
    background: transparent;
}

table th,
table td {
    padding: 8px 10px;
    vertical-align: top;
    border-bottom: 1px solid #d6dbee;
}

table th {
    background: #e8eaf7;
    color: #111;
    text-align: left;
    border-bottom-color: #c8cce8;
    font-weight: 700;
}

table thead th:first-child,
table > tbody > tr:first-child > th:first-child {
    border-top-left-radius: 6px;
}

table thead th:last-child,
table > tbody > tr:first-child > th:last-child {
    border-top-right-radius: 6px;
}

table tbody tr:nth-child(even) td {
    background: #fafbff;
}

table tbody tr:hover td {
    background: #f1f4ff;
}

.inventory-table {
    width: 100%;
    min-width: 720px;
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.section-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
}

.section-table th,
.section-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #d6dbee;
    vertical-align: top;
}

.section-table th {
    background: #e8eaf7;
    color: #111;
    text-align: left;
}

.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-justify {
    text-align: justify;
}

.section-table tbody tr:last-child td {
    border-bottom: 0;
}

.section-table input,
.section-table select,
.section-table textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
}

.section-table input[type="checkbox"] {
    width: auto;
    min-width: 0;
    padding: 0;
}

.equipment-flags-table td {
    text-align: left;
    vertical-align: middle;
}

.section-table textarea {
    min-height: 110px;
    resize: vertical;
}

.event-request-page {
    background: linear-gradient(180deg, #0f0f0f 0%, #1c1c1c 40%, #0a0a0a 100%);
    padding: 40px 20px 80px;
    min-height: 100vh;
}

.event-request-shell {
    max-width: 960px;
    margin: 0 auto;
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.35);
    position: relative;
    width: min(960px, 100%);
    box-sizing: border-box;
}

.event-request-header {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 16px;
}

.event-request-header img {
    height: 60px;
    width: auto;
    display: block;
}

.event-request-shell h1 {
    margin-top: 0;
}

.eyebrow {
    color: #737ab7;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.8em;
    margin-bottom: 6px;
}

.flash-messages {
    list-style: none;
    padding: 0;
    margin: 16px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.flash-messages li {
    padding: 10px 14px;
    border-radius: 6px;
    background: #f2f2f2;
}

.flash-success {
    background: #e3fbdc;
    color: #1c6910;
}

.flash-error {
    background: #fce8e6;
    color: #a00000;
}

.event-request-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-section {
    background: #fafbff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #d6dbee;
    box-shadow: inset 0 0 0 1px rgba(115, 122, 183, 0.08);
    box-sizing: border-box;
}

.form-section header h2 {
    margin: 0;
}

.form-section header p {
    margin: 4px 0 12px;
    color: #555;
    font-size: 0.95em;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    position: relative;
}

.form-field label {
    font-weight: 600;
    color: #1b1b1b;
}

.form-field input,
.form-field textarea,
.form-field select {
    box-sizing: border-box;
}

.helper-text {
    font-size: 0.9em;
    line-height: 1.5;
    color: #2c2c2c;
    margin-top: 8px;
}

.temporary-notice {
    background: #fff8e6;
    border: 1px solid #f0c869;
    border-radius: 8px;
    margin: 0 0 20px;
    padding: 12px 14px;
}

.helper-text ul {
    padding-left: 18px;
    margin: 6px 0 0;
}

.description-field {
    row-gap: 10px;
}

.description-label {
    font-size: 1rem;
}

.description-helper ul {
    list-style: disc;
    padding-left: 20px;
}

.form-field input,
.form-field textarea,
.form-field select {
    border: 1px solid #cfd1e5;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 1em;
    transition: border 0.2s ease;
    background: #fff;
    max-width: 100%;
    min-width: 0;
}

.form-field.split input,
.form-field.split textarea {
    width: 100%;
    min-width: 0;
}

.form-field.split > div {
    min-width: 0;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    border-color: #737ab7;
    outline: none;
    box-shadow: 0 0 0 2px rgba(115, 122, 183, 0.2);
}

.form-field input.invalid,
.form-field textarea.invalid,
.form-field select.invalid {
    border-color: #b42318;
    box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.18);
}

.form-field input.valid,
.form-field textarea.valid,
.form-field select.valid {
    border-color: #18803d;
    box-shadow: 0 0 0 2px rgba(24, 128, 61, 0.12);
}

.error-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #b42318;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85em;
    line-height: 1.3;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.15);
    position: relative;
    max-width: 100%;
}

.error-text:empty {
    display: none;
}

.error-text::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 14px;
    width: 8px;
    height: 8px;
    background: #b42318;
    transform: rotate(45deg);
}

.form-field.split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}

.checkbox-row.spaced {
    padding-left: 4px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.form-actions button,
.form-actions input[type="submit"] {
    background: #111;
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.form-actions button:hover,
.form-actions input[type="submit"]:hover {
    background: #2e2e2e;
}

.inventory-bulk-actions {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.inventory-bulk-actions label {
    font-weight: 600;
}

.inventory-bulk-actions select {
    min-width: 240px;
    max-width: 100%;
    padding: 7px 8px;
    box-sizing: border-box;
}

.equipment-save-button,
.inventory-save-button {
    margin-top: 8px;
}

#items-table .name-input {
    width: 100%;
    box-sizing: border-box;
}

#items-table input[type="text"],
#items-table input[type="number"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

#items-table select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.full-textarea {
    width: 100%;
    box-sizing: border-box;
}

.totals-table {
    width: auto;
}

.totals-table td {
    padding: 4px 6px;
}

.totals-table td:first-child {
    padding-right: 8px;
    white-space: nowrap;
}

@media (max-width: 900px) {
    #items-table col:nth-child(1) { width: 6% !important; }
    #items-table col:nth-child(2) { width: 34% !important; }
    #items-table col:nth-child(3) { width: 7% !important; }
    #items-table col:nth-child(4) { width: 10% !important; }
    #items-table col:nth-child(5) { width: 10% !important; }
    #items-table col:nth-child(6) { width: 7% !important; }
    #items-table col:nth-child(7) { width: 16% !important; }
    #items-table col:nth-child(8) { width: 10% !important; }

    #items-table th,
    #items-table td {
        padding: 4px;
    }
}

.btn {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    border: none;
    background: #111;
    color: #fff;
    cursor: pointer;
}

.btn:hover {
    background: #2a2a2a;
}

.btn-primary {
    background: #111;
}

.btn-secondary {
    background: #4a4a4a;
}

.btn-danger {
    background: #9a2b2b;
}

.btn-warning {
    background: #c98300;
}

.btn-outline {
    background: transparent;
    color: #111;
    border: 1px solid #111;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.9em;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-slider {
    width: 44px;
    height: 22px;
    border-radius: 999px;
    background: #d1d4e8;
    position: relative;
    transition: background 0.2s ease;
}

.toggle-slider::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: #111;
}

.toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(22px);
}

.toggle-text {
    font-size: 0.95em;
    color: #111;
}

.alert {
    margin: 12px 20px;
    padding: 10px 12px;
    border-radius: 4px;
}

.alert-success {
    background: #e3f2e6;
    color: #205c2c;
}

.alert-warning {
    background: #fff2d8;
    color: #7a4a00;
}

.alert-danger {
    background: #fde3e3;
    color: #7c1f1f;
}

.error-page {
    margin: 0;
    background: radial-gradient(circle at top, #f7f2e8 0%, #f0efe9 35%, #e2e8f0 100%);
    min-height: 100vh;
}

.error-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    padding: 40px 20px;
    box-sizing: border-box;
}

.error-card {
    max-width: 520px;
    background: #ffffff;
    border-radius: 18px;
    padding: 36px 40px;
    box-shadow: 0 18px 50px rgba(16, 24, 40, 0.18);
    border: 1px solid rgba(17, 17, 17, 0.08);
}

.error-card h1 {
    margin: 8px 0 12px;
    font-size: 2.1rem;
    color: #111;
}

.error-eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-size: 0.75rem;
    color: #69707d;
    font-weight: 600;
}

.error-lede {
    margin: 0 0 24px;
    color: #2f3440;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.error-orbit {
    position: relative;
    width: 240px;
    height: 240px;
}

.error-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px dashed rgba(17, 17, 17, 0.18);
    animation: slow-spin 18s linear infinite;
}

.error-dot {
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #111;
    top: 18px;
    left: 70%;
    box-shadow: 0 8px 18px rgba(17, 17, 17, 0.25);
}

.error-dot.secondary {
    width: 14px;
    height: 14px;
    background: #737ab7;
    top: auto;
    left: 18%;
    bottom: 28px;
}

@keyframes slow-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 900px) {
    .error-hero {
        flex-direction: column;
        text-align: center;
    }

    .error-card {
        padding: 32px 28px;
    }

    .error-actions {
        justify-content: center;
    }
}
