.qunigest-wrap {
    max-width: 1280px;
}

.qunigest-admin-app {
    margin-top: 16px;
}

.qunigest-public {
    box-sizing: border-box;
    color: #1f2933;
    font-family: var(--wp--preset--font-family--body, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    margin: 0 auto;
    max-width: 1200px;
    padding: 32px 20px;
}

.qunigest-public * {
    box-sizing: border-box;
}

.qunigest-login-panel {
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid #d6dde5;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 48px;
    max-width: 560px;
}

.qunigest-login-panel h1,
.qunigest-app-header h1 {
    line-height: 1.1;
    margin: 0;
}

.qunigest-login-panel p,
.qunigest-kicker {
    margin: 0;
}

.qunigest-app-page {
    left: 50%;
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    position: relative;
    transform: translateX(-50%);
    width: min(1280px, calc(100vw - 24px));
}

body.qunigest-app-template .wp-site-blocks > header,
body.qunigest-app-template .wp-site-blocks > footer,
body.qunigest-app-template .wp-block-post-title,
body.qunigest-app-template .wp-block-query-title {
    display: none !important;
}

body.qunigest-app-template .wp-site-blocks,
body.qunigest-app-template main,
body.qunigest-app-template .entry-content,
body.qunigest-app-template .wp-block-post-content {
    margin-block-start: 0 !important;
    padding-block-start: 0 !important;
}

body.qunigest-app-template .entry-content > *,
body.qunigest-app-template .wp-block-post-content > * {
    max-width: none !important;
}

.qunigest-app-header {
    align-items: center;
    border-bottom: 1px solid #d6dde5;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 18px;
}

.qunigest-kicker {
    color: #4b5563;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}

.qunigest-frontend-app {
    margin-top: 0;
    overflow-x: auto;
}

.qunigest-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.qunigest-toolbar input[type="search"] {
    width: min(520px, 100%);
}

.qunigest-status {
    min-height: 24px;
    margin-bottom: 8px;
}

.qunigest-status.is-error {
    color: #b32d2e;
}

.qunigest-button {
    align-items: center;
    background: #0f766e;
    border: 1px solid #0f766e;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    justify-content: center;
    line-height: 1;
    min-height: 38px;
    padding: 0 14px;
    text-decoration: none;
}

.qunigest-button:hover,
.qunigest-button:focus {
    background: #115e59;
    border-color: #115e59;
    color: #ffffff;
}

.qunigest-button-secondary {
    background: #ffffff;
    color: #1f2933;
}

.qunigest-button-secondary:hover,
.qunigest-button-secondary:focus {
    background: #f4f7f9;
    color: #1f2933;
}

.qunigest-table {
    border: 1px solid #d6dde5;
    border-collapse: collapse;
    min-width: 760px;
    width: 100%;
}

.qunigest-table td,
.qunigest-table th {
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
}

.qg-legacy-shell {
    background: #ece9d8;
    border: 1px solid #6f6f6f;
    color: #000000;
    font-family: Tahoma, Verdana, Arial, sans-serif;
    font-size: 12px;
    line-height: 1.25;
    min-height: 680px;
    overflow: hidden;
}

.qg-window-title {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid #b5b5b5;
    display: flex;
    font-size: 13px;
    justify-content: space-between;
    min-height: 28px;
    padding: 4px 8px;
}

.qg-window-title a {
    color: #003399;
    font-size: 12px;
    text-decoration: none;
}

.qg-menu-bar {
    align-items: center;
    background: #f6f6f6;
    border-bottom: 1px solid #aaa;
    display: flex;
    gap: 16px;
    min-height: 24px;
    padding: 3px 8px;
    white-space: nowrap;
}

.qg-filter-bar {
    align-items: center;
    background: linear-gradient(#fef7dc, #d5c28d);
    border-bottom: 1px solid #8f8054;
    display: grid;
    gap: 4px;
    grid-template-columns: minmax(180px, 280px) minmax(160px, 1fr) minmax(160px, 1fr) auto auto;
    min-height: 32px;
    padding: 3px 6px;
}

.qg-filter-bar label {
    align-items: center;
    display: grid;
    gap: 4px;
    grid-template-columns: auto 1fr;
    margin: 0;
}

.qg-filter-bar input,
.qg-filter-bar select {
    border: 1px solid #777;
    font: inherit;
    height: 22px;
    min-width: 0;
    padding: 1px 4px;
}

.qg-flat-button,
.qg-index-toolbar button {
    background: linear-gradient(#ffffff, #d7d7d7);
    border: 1px solid #8f8f8f;
    color: #000000;
    cursor: pointer;
    font: inherit;
    min-height: 23px;
    padding: 2px 7px;
}

.qg-flat-button:hover,
.qg-index-toolbar button:hover,
.qg-subject-list button:hover {
    background: #dbeafe;
}

.qg-workbench {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    min-height: 620px;
}

.qg-index-pane {
    background: #ffffff;
    border-right: 1px solid #777;
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
}

.qg-index-toolbar {
    background: #f2e7aa;
    border-bottom: 1px solid #a09055;
    display: flex;
    gap: 4px;
    padding: 3px 6px;
}

.qg-index-toolbar button {
    align-items: center;
    display: inline-flex;
    font-size: 14px;
    height: 24px;
    justify-content: center;
    min-width: 24px;
    padding: 0 6px;
}

.qg-index-toolbar button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.qg-index-list-wrap {
    display: grid;
    grid-template-columns: 22px 1fr;
    min-height: 0;
}

.qg-alpha-rail {
    background: #fff1a3;
    border-right: 1px solid #aa9132;
    display: grid;
    grid-auto-rows: 22px;
    justify-items: center;
    padding-top: 2px;
}

.qg-alpha-rail span {
    color: #000000;
    font-weight: 700;
}

.qg-subject-list {
    overflow: auto;
    padding: 2px;
}

.qg-subject-list button {
    background: #ffffff;
    border: 1px solid transparent;
    color: #000000;
    cursor: pointer;
    display: block;
    font: inherit;
    margin: 0 0 2px;
    min-height: 24px;
    padding: 3px 5px;
    text-align: left;
    width: 100%;
}

.qg-subject-list button.is-active {
    background: #0b65c2;
    color: #ffffff;
}

.qg-subject-list button small {
    display: block;
    font-size: 10px;
    opacity: .8;
}

.qg-subject-list button.is-empty {
    color: #555555;
}

.qg-detail-pane {
    background: linear-gradient(120deg, #fff0a6 0%, #f8e7a0 58%, #eef3c6 100%);
    min-width: 0;
    padding: 4px 10px 14px;
}

.qg-tabs {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    min-height: 28px;
}

.qg-tabs button {
    background: linear-gradient(#fbfbfb, #d6d6d6);
    border: 1px solid #8d8d8d;
    border-bottom-color: #6f6f6f;
    border-radius: 5px 5px 0 0;
    color: #000000;
    cursor: pointer;
    font: inherit;
    min-height: 26px;
    padding: 4px 14px;
}

.qg-tabs button.is-active {
    background: #fff0a6;
    border-bottom-color: #fff0a6;
    color: #000000;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.qg-status {
    border-top: 1px solid #8d8d8d;
    color: #0042a3;
    font-size: 11px;
    margin: 0 0 4px;
    min-height: 20px;
    padding: 3px 2px;
}

.qg-tab-panel {
    display: none;
}

.qg-tab-panel.is-active {
    display: block;
}

.qg-tab-panel label,
.qg-placeholder-grid label {
    align-items: center;
    color: #00159b;
    display: grid;
    font-weight: 700;
    gap: 5px;
    grid-template-columns: 96px minmax(0, 1fr);
    margin: 0 0 6px;
}

.qg-tab-panel input,
.qg-tab-panel select,
.qg-tab-panel textarea {
    background: #ffffff;
    border: 1px solid #777777;
    color: #000000;
    font: 12px Tahoma, Verdana, Arial, sans-serif;
    min-height: 22px;
    min-width: 0;
    padding: 2px 4px;
    width: 100%;
}

.qg-tab-panel textarea {
    resize: vertical;
}

.qg-form-row {
    display: grid;
    gap: 8px;
    margin-bottom: 6px;
}

.qg-form-row-codes {
    grid-template-columns: minmax(160px, 1fr) 80px minmax(180px, 1.2fr);
}

.qg-form-row-codes label {
    grid-template-columns: 44px minmax(0, 1fr);
    margin: 0;
}

.qg-form-grid {
    display: grid;
    gap: 8px;
}

.qg-form-grid-two {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.qg-checkbox {
    align-items: center !important;
    color: #00159b;
    display: flex !important;
    font-weight: 400 !important;
    gap: 6px !important;
    grid-template-columns: none !important;
}

.qg-checkbox input {
    height: 14px;
    min-height: 0;
    width: 14px;
}

.qg-address-panels {
    border-top: 1px solid #be2222;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin: 12px 0 10px;
    padding-top: 6px;
}

.qg-address-panels fieldset {
    border: 1px solid #a98c55;
    margin: 0;
    padding: 8px 8px 6px;
}

.qg-address-panels legend {
    color: #cb0000;
    font-weight: 700;
    padding: 0 4px;
}

.qg-address-panels label {
    grid-template-columns: 58px minmax(0, 1fr);
}

.qg-pec-row {
    border-top: 1px solid #be2222;
    margin-top: 18px !important;
    padding-top: 6px;
}

.qg-placeholder-grid {
    display: grid;
    gap: 8px;
    padding: 18px 4px;
}

@media (max-width: 640px) {
    .qunigest-public {
        padding: 24px 16px;
    }

    .qunigest-app-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .qunigest-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .qunigest-toolbar input[type="search"],
    .qunigest-toolbar button {
        width: 100%;
    }
}

@media (max-width: 980px) {
    .qg-filter-bar {
        grid-template-columns: 1fr 1fr;
    }

    .qg-workbench {
        grid-template-columns: 1fr;
    }

    .qg-index-pane {
        border-right: 0;
        border-bottom: 1px solid #777;
        max-height: 260px;
    }

    .qg-address-panels,
    .qg-form-grid-two,
    .qg-form-row-codes {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .qg-legacy-shell {
        min-height: 0;
    }

    .qg-menu-bar,
    .qg-filter-bar,
    .qg-tabs {
        overflow-x: auto;
    }

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

    .qg-tab-panel label,
    .qg-address-panels label,
    .qg-placeholder-grid label {
        grid-template-columns: 1fr;
    }
}
