.bcms-panel,
.bcms-login-box,
.bcms-scoreboard {
    max-width: 1200px;
    margin: 0 auto 24px;
    padding: 18px;
    background: #fff;
    border: 1px solid #d7deea;
    border-radius: 16px;
    box-sizing: border-box;
    box-shadow: 0 8px 24px rgba(21, 54, 92, 0.06);
}

.bcms-filter-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin: 0 0 18px;
}

.bcms-performance-card {
    border: 1px solid #d7deea;
    border-radius: 14px;
    padding: 16px;
    margin: 0 0 16px;
    background: #f9fbff;
}

.bcms-performance-layout {
    display: grid;
    grid-template-columns: 62px 1fr;
    gap: 14px;
    align-items: flex-start;
}

.bcms-ordinal-col {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: #16375a;
    padding-top: 6px;
    text-align: center;
}

.bcms-performance-main {
    min-width: 0;
}

.bcms-line {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 10px;
}

.bcms-grid-four {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 10px;
}

.bcms-field-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.bcms-field-label {
    font-size: 14px;
    font-weight: 500;
    color: #55687b;
}

.bcms-field-value {
    font-size: 20px;
    line-height: 1.25;
    color: #16375a;
    word-break: break-word;
}

.bcms-field-strong {
    font-weight: 700;
}

.bcms-line-1 .bcms-field-label,
.bcms-line-1 .bcms-field-value {
    font-size: 16px;
}

.bcms-line-2 {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    color: #16375a;
    font-size: 16px;
    line-height: 1.35;
}

.bcms-line-2 strong,
.bcms-line-2 .bcms-inline-value {
    font-weight: 700;
}

.bcms-inline-field {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.bcms-inline-field .bcms-field-label {
    font-size: 16px;
    line-height: 1.35;
    font-weight: 400;
    color: #44576b;
}

.bcms-inline-field .bcms-field-value {
    font-size: 16px;
    line-height: 1.35;
    font-weight: 700;
    color: #16375a;
}

.bcms-line-3 .bcms-field-label,
.bcms-line-3 .bcms-field-value,
.bcms-line-3 .bcms-inline-field .bcms-field-label,
.bcms-line-3 .bcms-inline-field .bcms-field-value {
    font-size: 16px !important;
    line-height: 1.35;
}

.bcms-criteria-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.bcms-criteria-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bcms-score-input {
    width: 170px;
    max-width: 100%;
    font-size: 22px;
    padding: 10px;
    border: 2px solid #1f4c7a;
    border-radius: 10px;
    background: #fffced;
}

.bcms-mobile-note {
    opacity: 0.95;
    background: #eef4ff;
    border-left: 4px solid #1f4c7a;
    padding: 10px 12px;
    border-radius: 8px;
    margin-top: 0;
}

.bcms-login-box {
    max-width: 520px;
}

.bcms-scoreboard-table-wrap {
    overflow: auto;
}

.bcms-director-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 18px;
}

.bcms-summary-card {
    background: #f5f8fe;
    border: 1px solid #d7deea;
    border-radius: 12px;
    padding: 12px;
}

.bcms-integrity-list {
    padding-left: 18px;
}

.bcms-judge-panel .button-primary {
    background: #1f6f4a;
    border-color: #1f6f4a;
}

.bcms-judge-panel .bcms-performance-card:nth-child(odd) {
    background: #f6fbff;
}

.bcms-judge-panel .bcms-performance-card:nth-child(even) {
    background: #fff9f1;
}

.bcms-director-panel table.widefat thead th,
.bcms-scoreboard table.widefat thead th {
    background: #16375a;
    color: #fff;
}

.bcms-director-panel table.widefat tbody tr:nth-child(odd),
.bcms-scoreboard table.widefat tbody tr:nth-child(odd) {
    background: #f7f9fc;
}

.bcms-director-panel table.widefat tbody tr:hover,
.bcms-scoreboard table.widefat tbody tr:hover {
    background: #eef4ff;
}

.bcms-alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin: 0 0 10px;
}

.bcms-alert-danger {
    background: #fff0f0;
    border-left: 4px solid #bf1f2f;
    color: #6e1020;
}

.bcms-alert-warning {
    background: #fff8e6;
    border-left: 4px solid #d39a00;
    color: #6a5000;
}

.bcms-alert-success {
    background: #eefaf2;
    border-left: 4px solid #1f6f4a;
    color: #1d4a31;
}

.bcms-alert-subtext {
    margin-top: 6px;
    font-size: 15px;
}

.bcms-freeze-window {
    margin: 0 0 14px;
}

.bcms-freeze-window:empty {
    display: none;
}

.bcms-problem-box {
    background: #f7f9fc;
    border: 1px solid #d7deea;
    border-radius: 12px;
    padding: 10px 12px;
    margin: 0 0 14px;
}

.bcms-problem-status {
    margin-top: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.bcms-problem-status form {
    display: inline-block;
    margin-left: 10px;
}

.bcms-category-block-title {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #16375a;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    margin: 16px 0 10px;
    font-weight: 700;
}

.bcms-welcome-box {
    position: relative;
    background: #eefaf2;
    border-left: 4px solid #1f6f4a;
    border-radius: 12px;
    padding: 14px 44px 14px 14px;
    margin: 0 0 14px;
}

.bcms-dismiss {
    position: absolute;
    top: 8px;
    right: 8px;
    border: 0;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #355;
}

.bcms-modal[hidden] {
    display: none;
}

.bcms-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
}

.bcms-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.bcms-modal-dialog {
    position: relative;
    z-index: 2;
    max-width: 760px;
    margin: 5vh auto;
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    max-height: 85vh;
    overflow: auto;
}

.bcms-modal-x {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: 0;
    font-size: 28px;
    cursor: pointer;
}

.bcms-floating-problem {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9999;
    max-width: 340px;
    width: calc(100% - 36px);
}

.bcms-floating-problem details {
    background: #fff;
    border: 2px solid #bf1f2f;
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.bcms-floating-problem summary {
    font-weight: 700;
    color: #6e1020;
    cursor: pointer;
}

.bcms-problem-resolve-form {
    margin-top: 10px;
}

.bcms-live-overlay-wrap {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    pointer-events: none;
}

.bcms-live-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
}

.bcms-live-overlay-box {
    position: relative;
    z-index: 2;
    max-width: 760px;
    width: min(760px, 100%);
    pointer-events: auto;
}

.bcms-live-overlay-box .bcms-alert {
    margin: 0 0 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    font-size: 24px;
    line-height: 1.35;
    border-left-width: 6px;
    padding: 18px 22px;
}

.bcms-live-overlay-box .bcms-alert:last-child {
    margin-bottom: 0;
}

.bcms-live-overlay-notice {
    align-items: center;
    justify-content: center;
    padding-top: 20px;
}

.bcms-live-overlay-notice .bcms-live-overlay-box {
    max-width: 640px;
}

.bcms-live-overlay-notice .bcms-alert {
    font-size: 20px;
}

.bcms-break-marker {
    margin: 14px 0;
    padding: 14px 18px;
    border-radius: 12px;
    background: #fff4cc;
    border: 2px dashed #d39a00;
    color: #6a5000;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

@media (max-width: 900px) {
    .bcms-criteria-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bcms-director-summary {
        grid-template-columns: 1fr;
    }

    .bcms-grid-four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .bcms-panel,
    .bcms-login-box,
    .bcms-scoreboard {
        padding: 12px;
        border-radius: 10px;
    }

    .bcms-filter-form {
        align-items: stretch;
    }

    .bcms-filter-form select,
    .bcms-filter-form button {
        width: 100%;
    }

    .bcms-criteria-grid {
        grid-template-columns: 1fr;
    }

    .bcms-performance-card {
        padding: 12px;
    }

    .bcms-performance-layout {
        grid-template-columns: 42px 1fr;
        gap: 10px;
    }

    .bcms-ordinal-col {
        font-size: 24px;
    }

    .bcms-grid-four {
        grid-template-columns: 1fr;
    }

    .bcms-field-label,
    .bcms-field-value,
    .bcms-line-2,
    .bcms-inline-field .bcms-field-label,
    .bcms-inline-field .bcms-field-value {
        font-size: 18px;
    }

    .bcms-line-3 .bcms-field-label,
    .bcms-line-3 .bcms-field-value,
    .bcms-line-3 .bcms-inline-field .bcms-field-label,
    .bcms-line-3 .bcms-inline-field .bcms-field-value {
        font-size: 14px !important;
    }

    .bcms-score-input {
        width: 100%;
        font-size: 24px;
        padding: 12px;
    }

    .bcms-panel .widefat {
        font-size: 13px;
    }

    .bcms-modal-dialog {
        margin: 0;
        border-radius: 0;
        max-width: none;
        min-height: 100vh;
    }

    .bcms-floating-problem {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        max-width: none;
    }

    .bcms-live-overlay-box .bcms-alert {
        font-size: 20px;
        padding: 16px 18px;
    }
}


.bcms-live-overlay-box .bcms-alert {
  font-size: 24px;
  line-height: 1.35;
}

.bcms-live-overlay-box .bcms-alert-subtext {
  font-size: 20px;
  line-height: 1.4;
}

.bcms-performance-card {
  transition: box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}

.bcms-performance-card.bcms-card-current {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.18);
  background: #eff6ff;
}

.bcms-performance-card.bcms-card-saved {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22,163,74,.18);
  background: #f0fdf4;
}

.bcms-performance-card.bcms-card-save-error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.15);
}

.bcms-score-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.bcms-save-indicator {
  font-weight: 700;
  min-height: 1.2em;
}

.bcms-save-indicator.is-saving { color: #1d4ed8; }
.bcms-save-indicator.is-success { color: #15803d; }
.bcms-save-indicator.is-error { color: #b91c1c; }


.bcms-director-ranking-section,
.bcms-director-performance-section {
  width: 100%;
  margin: 0 auto 24px;
}

.bcms-ranking-preview-group {
  width: 100%;
  max-width: 100%;
  margin: 0 auto 22px;
}

.bcms-director-panel .bcms-ranking-table,
.bcms-director-panel .bcms-performance-overview-table {
  width: 100%;
  table-layout: fixed;
  margin-left: auto;
  margin-right: auto;
}

.bcms-director-panel .bcms-ranking-table th,
.bcms-director-panel .bcms-ranking-table td,
.bcms-director-panel .bcms-performance-overview-table th,
.bcms-director-panel .bcms-performance-overview-table td {
  white-space: nowrap;
  word-break: normal;
  text-align: center;
  vertical-align: middle;
  font-size: 12px;
  padding: 8px 6px;
}

.bcms-live-overlay-box .bcms-alert-warning,
.bcms-live-overlay-box .bcms-alert-danger {
  font-size: 26px;
}

.bcms-live-overlay-box .bcms-alert-subtext {
  font-size: 22px;
  line-height: 1.45;
}


.bcms-floating-ranking {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 9998;
}

.bcms-floating-ranking .button {
    box-shadow: 0 10px 24px rgba(0,0,0,0.18);
    border-radius: 999px;
    padding: 10px 14px;
}

.bcms-problem-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    color: #6e1020;
    cursor: pointer;
}

.bcms-floating-problem details {
    position: relative;
    padding-top: 14px;
}

.bcms-ranking-group-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.bcms-ranking-group-header h4 {
    margin: 0 0 10px;
}

.bcms-director-ranking-section .bcms-table-wrap {
    overflow-x: auto;
}

@media (max-width: 768px) {
    .bcms-floating-ranking,
    .bcms-floating-problem {
        width: calc(100% - 36px);
    }

    .bcms-floating-ranking .button {
        width: 100%;
    }
}


.bcms-ranking-description {
    margin-top: 18px;
}

.bcms-jury-position {
    width: 90px;
    max-width: 100%;
    padding: 6px 8px;
    text-align: center;
}

.bcms-problem-close {
    color: #000;
    border: none;
    outline: none;
    box-shadow: none;
    background: transparent;
}

.bcms-floating-ranking {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 9998;
}

.bcms-floating-ranking .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bcms-problem-close:hover,
.bcms-problem-close:focus,
.bcms-problem-close:active {
    color: #000;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.bcms-director-panel .bcms-ranking-table thead th,
.bcms-director-panel .bcms-performance-overview-table thead th {
    white-space: nowrap;
    word-break: normal;
}

/* Ranking preview: keep header labels and competitor names inside cells */
.bcms-director-panel .bcms-table-wrap {
    overflow-x: auto;
}

.bcms-director-panel .bcms-ranking-table,
.bcms-director-panel .bcms-performance-overview-table {
    width: 100%;
    min-width: 1400px;
    table-layout: fixed;
}

.bcms-director-panel .bcms-ranking-table th,
.bcms-director-panel .bcms-ranking-table td,
.bcms-director-panel .bcms-performance-overview-table th,
.bcms-director-panel .bcms-performance-overview-table td {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    line-height: 1.25;
    vertical-align: middle;
}

.bcms-director-panel .bcms-ranking-table thead th,
.bcms-director-panel .bcms-performance-overview-table thead th {
    padding-top: 10px;
    padding-bottom: 10px;
    text-align: center;
}

.bcms-director-panel .bcms-ranking-table td:nth-child(4),
.bcms-director-panel .bcms-ranking-table th:nth-child(4),
.bcms-director-panel .bcms-performance-overview-table td:nth-child(3),
.bcms-director-panel .bcms-performance-overview-table th:nth-child(3) {
    min-width: 160px;
}

.bcms-director-panel .bcms-ranking-table td:nth-child(2),
.bcms-director-panel .bcms-ranking-table th:nth-child(2) {
    min-width: 120px;
}


/* Ranking preview robust wrapping fix */
.bcms-director-panel .bcms-table-wrap {
    overflow-x: auto;
}

.bcms-director-panel .bcms-ranking-table,
.bcms-director-panel .bcms-performance-overview-table {
    table-layout: auto !important;
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

.bcms-director-panel .bcms-ranking-table th,
.bcms-director-panel .bcms-ranking-table td,
.bcms-director-panel .bcms-performance-overview-table th,
.bcms-director-panel .bcms-performance-overview-table td {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    vertical-align: middle;
}

.bcms-director-panel .bcms-ranking-table thead th .bcms-th-label,
.bcms-director-panel .bcms-performance-overview-table thead th .bcms-th-label {
    display: block;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    line-height: 1.2;
    min-width: 72px;
}

.bcms-director-panel .bcms-ranking-table td .bcms-cell-name,
.bcms-director-panel .bcms-performance-overview-table td .bcms-cell-name {
    display: inline-block;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    line-height: 1.2;
    min-width: 0;
    max-width: 180px;
}

.bcms-director-panel .bcms-ranking-table th:nth-child(4),
.bcms-director-panel .bcms-ranking-table td:nth-child(4),
.bcms-director-panel .bcms-performance-overview-table th:nth-child(3),
.bcms-director-panel .bcms-performance-overview-table td:nth-child(3) {
    width: 180px;
    min-width: 180px;
}

.bcms-director-panel .bcms-ranking-table th:nth-child(2),
.bcms-director-panel .bcms-ranking-table td:nth-child(2) {
    width: 120px;
    min-width: 120px;
}

/* Final table polish: enforce wrapped headers and names in Ranking Preview */
.bcms-director-panel .bcms-ranking-table,
.bcms-director-panel .bcms-performance-overview-table {
    table-layout: fixed !important;
    width: 100% !important;
    min-width: 1500px;
}

.bcms-director-panel .bcms-ranking-table th,
.bcms-director-panel .bcms-ranking-table td,
.bcms-director-panel .bcms-performance-overview-table th,
.bcms-director-panel .bcms-performance-overview-table td {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto;
    overflow: hidden;
    text-overflow: clip;
}

.bcms-director-panel .bcms-ranking-table thead th .bcms-th-label,
.bcms-director-panel .bcms-performance-overview-table thead th .bcms-th-label {
    display: block !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.15;
    text-align: center;
}

.bcms-director-panel .bcms-ranking-table td .bcms-cell-name,
.bcms-director-panel .bcms-performance-overview-table td .bcms-cell-name {
    display: block !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.15;
    max-width: 100%;
}

.bcms-director-panel .bcms-ranking-table th:nth-child(2),
.bcms-director-panel .bcms-ranking-table td:nth-child(2) {
    width: 96px !important;
}

.bcms-director-panel .bcms-ranking-table th:nth-child(4),
.bcms-director-panel .bcms-ranking-table td:nth-child(4),
.bcms-director-panel .bcms-performance-overview-table th:nth-child(3),
.bcms-director-panel .bcms-performance-overview-table td:nth-child(3) {
    width: 120px !important;
}


.bcms-final-place-pill {
    display: inline-flex;
    min-width: 42px;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef4ff;
    border: 1px solid #cfdcf0;
    font-weight: 600;
}

.bcms-final-jury-order-modal[hidden] {
    display: none !important;
}

.bcms-final-jury-order-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.bcms-final-jury-order-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 23, 39, 0.45);
}

.bcms-final-jury-order-dialog {
    position: relative;
    z-index: 1;
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    margin: 16px auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(10, 23, 39, 0.18);
    padding: 20px;
}

.bcms-final-jury-order-header,
.bcms-final-jury-order-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.bcms-final-jury-order-message {
    margin: 12px 0;
    min-height: 24px;
    padding: 0;
}

.bcms-final-jury-order-message.is-error,
.bcms-final-jury-order-message.is-success {
    padding: 10px 12px;
    border-radius: 10px;
}

.bcms-final-jury-order-message.is-error {
    background: #fff0f0;
    color: #6e1020;
    border-left: 4px solid #bf1f2f;
}

.bcms-final-jury-order-message.is-success {
    background: #eefaf2;
    color: #1d4a31;
    border-left: 4px solid #1f6f4a;
}

.bcms-final-jury-order-table .bcms-jury-position {
    width: 110px;
}

.bcms-final-jury-order-table tbody tr.is-changed {
    background: #f3fbf5;
}

.bcms-final-jury-order-table .bcms-jury-position.is-default {
    color: #5c6773;
    border-color: #cfd7df;
    background: #f8fafc;
    font-weight: 600;
}

.bcms-final-jury-order-table .bcms-jury-position.is-changed {
    color: #1f6f4a;
    border-color: #8fc7a6;
    background: #eefaf2;
    font-weight: 700;
}

@media (max-width: 768px) {
    .bcms-final-jury-order-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
        margin: 8px auto;
        padding: 14px;
    }
}


.bcms-ranking-group-card {
    margin-bottom: 0;
}

.bcms-ranking-group-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.bcms-ranking-group-divider {
    margin: 24px 0 22px;
    height: 1px;
    background: #e4e7eb;
}

.bcms-ranking-group-card:last-of-type .bcms-ranking-group-divider {
    display: none;
}

.bcms-ranking-group-note {
    margin: 0;
}

.bcms-open-final-jury-order {
    flex-shrink: 0;
}



.bcms-results-finalize-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 18px;
}

.bcms-results-finalize-status {
  font-weight: 600;
}

.bcms-results-finalize-status.is-finalized {
  color: #2e7d32;
}

.bcms-results-finalize-status.is-draft {
  color: #666;
}

.bcms-finalize-results-button.is-finalized,
.bcms-open-final-jury-order[disabled] {
  cursor: not-allowed;
}


.bcms-audit-trail-section {
  margin: 16px 0 22px;
}

.bcms-audit-trail-section h4 {
  margin: 0 0 10px;
}

.bcms-audit-trail-table th,
.bcms-audit-trail-table td {
  vertical-align: top;
}
