.awards-page {
    --aw-border: #dfe5eb;
    --aw-soft: #f6f8fa;
    --aw-soft-2: #eef3f7;
    --aw-text: #263442;
    --aw-muted: #71808f;
    --aw-accent: #355c7d;
    --aw-accent-soft: #eaf2f8;
    --aw-green: #247a52;
    --aw-orange: #a86300;
    --aw-danger: #b02a37;
    color: var(--aw-text);
    font-size: 14px;
}

.awards-page * { box-sizing: border-box; }

.awards-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.awards-page-title { margin: 0 0 4px; font-size: 24px; font-weight: 700; }
.awards-page-description { color: var(--aw-muted); line-height: 1.45; }

.awards-save-all {
    padding: 10px 18px;
    border: 0;
    border-radius: 8px;
    background: var(--aw-accent);
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}
.awards-save-all:hover { filter: brightness(.96); }
.awards-save-all:disabled { opacity: .6; cursor: default; }

.awards-page-note {
    margin: 0 0 16px;
    padding: 11px 13px;
    border: 1px solid #d8e4ee;
    background: #f5f9fc;
    border-radius: 8px;
    line-height: 1.45;
}

.awards-page-alert { padding: 12px; border-radius: 6px; }
.awards-page-alert-error { background: #fff1f1; color: #a32626; }

.awards-table-wrap {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--aw-border);
    border-radius: 10px;
    background: #fff;
}

.awards-table { width: 100%; min-width: 1640px; border-collapse: collapse; }
.awards-table th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #eef2f5;
    color: #344656;
    font-size: 12px;
    line-height: 1.25;
    text-align: center;
    padding: 10px 7px;
    border-bottom: 1px solid #ccd5dd;
    border-right: 1px solid #dde4e9;
    vertical-align: middle;
}
.awards-table td {
    padding: 9px 7px;
    border-bottom: 1px solid #e7ebef;
    border-right: 1px solid #edf0f2;
    vertical-align: top;
}
.awards-table tr.is-hidden-row { display: none; }

/* Hierarchy */
.awards-category-row {
    background: #fbfdff;
    border-top: 3px solid #b9cad8;
    transition: background .16s ease, box-shadow .16s ease;
}
.awards-category-row:hover { background: #f4f9fd; }
.awards-category-row.is-expanded {
    background: #edf6fc;
    box-shadow: inset 5px 0 0 var(--aw-accent);
}

.awards-level-row {
    background: #f7fafc;
    transition: background .16s ease, box-shadow .16s ease;
}
.awards-level-row:hover { background: #f0f6fa; }
.awards-level-row.is-expanded {
    background: #eef5fa;
    box-shadow: inset 5px 0 0 #7899b5;
}

.awards-dance-row {
    background: #fcfdfe;
    transition: background .14s ease;
}
.awards-dance-row:hover { background: #f4f8fb; }
.awards-row.has-override { box-shadow: inset 4px 0 0 #d0a64b; }
.awards-category-row.is-expanded.has-override { box-shadow: inset 5px 0 0 var(--aw-accent), inset 9px 0 0 #d0a64b; }
.awards-level-row.is-expanded.has-override { box-shadow: inset 5px 0 0 #7899b5, inset 9px 0 0 #d0a64b; }

.awards-category-col { width: 270px; }
.awards-setting-col { width: 210px; }
.awards-team-mode-col { width: 190px; }
.awards-depth-col { width: 340px; }

.awards-category-cell {
    min-width: 250px;
    padding: 14px 10px !important;
    background-image: linear-gradient(90deg, rgba(53,92,125,.065), rgba(53,92,125,0) 78%);
}
.awards-level-cell {
    position: relative;
    padding-left: 34px !important;
    border-left: 6px solid #c3d5e3 !important;
    background-image: linear-gradient(90deg, rgba(120,153,181,.08), rgba(120,153,181,0) 74%);
}
.awards-level-cell:before {
    content: '';
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #c8d8e4;
}
.awards-level-cell:after {
    content: '';
    position: absolute;
    left: 14px;
    top: 25px;
    width: 12px;
    height: 2px;
    background: #c8d8e4;
}
.awards-dance-cell {
    position: relative;
    padding-left: 62px !important;
    border-left: 6px solid #dce7ef !important;
    background-image: linear-gradient(90deg, rgba(170,191,207,.08), rgba(170,191,207,0) 68%);
}
.awards-dance-cell:before {
    content: '';
    position: absolute;
    left: 29px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #d8e4ed;
}
.awards-dance-cell:after {
    content: '';
    position: absolute;
    left: 29px;
    top: 24px;
    width: 20px;
    height: 2px;
    background: #d8e4ed;
}

.awards-category-toggle,
.awards-level-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 38px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.awards-category-toggle:hover {
    border-color: #bfd0de;
    background: rgba(255,255,255,.8);
    box-shadow: 0 1px 3px rgba(28,55,76,.08);
}
.awards-level-toggle:hover {
    border-color: #cbd9e4;
    background: rgba(255,255,255,.72);
}
.awards-category-toggle[aria-expanded="true"] {
    border-color: #9eb9cf;
    background: #fff;
    box-shadow: 0 2px 6px rgba(28,55,76,.10);
}
.awards-level-toggle[aria-expanded="true"] {
    border-color: #b4c9d9;
    background: #fff;
    box-shadow: 0 1px 4px rgba(28,55,76,.08);
}

.awards-category-chevron,
.awards-level-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    text-align: center;
    transition: transform .16s ease, background .16s ease;
}
.awards-category-chevron {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    margin-right: 8px;
    background: var(--aw-accent);
    font-size: 17px;
}
.awards-level-chevron {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    margin-right: 7px;
    background: #7899b5;
    font-size: 14px;
}
.awards-category-toggle[aria-expanded="true"] .awards-category-chevron,
.awards-level-toggle[aria-expanded="true"] .awards-level-chevron {
    transform: rotate(0deg) scale(1.05);
}

/* Category headings deliberately larger. */
.awards-category-name {
    font-size: 20px;
    font-weight: 850;
    line-height: 1.22;
    letter-spacing: .01em;
}
.awards-level-name {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.3;
}
.awards-level-name-static {
    position: relative;
    padding: 7px 8px 7px 31px;
    border-radius: 7px;
    background: rgba(255,255,255,.58);
}
.awards-level-name-static:before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    width: 10px;
    height: 10px;
    margin-top: -5px;
    border-radius: 50%;
    background: #7899b5;
}
.awards-dance-name {
    position: relative;
    display: inline-block;
    padding: 6px 9px;
    border: 1px solid #e0e8ee;
    border-radius: 7px;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.awards-child-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 25px;
    height: 21px;
    margin-left: 8px;
    padding: 0 7px;
    border-radius: 11px;
    background: var(--aw-accent-soft);
    color: var(--aw-accent);
    font-size: 11px;
    font-weight: 800;
}
.awards-child-count-level { background: #dfeaf2; color: #4e6f89; }
.awards-category-toggle[aria-expanded="true"] .awards-child-count { background: var(--aw-accent); color: #fff; }
.awards-level-toggle[aria-expanded="true"] .awards-child-count-level { background: #7899b5; color: #fff; }

.awards-toggle-caption { color: #6f7f8d; font-size: 11px; font-weight: 600; margin: 4px 0 0 38px; }
.awards-category-row.is-expanded .awards-toggle-caption,
.awards-level-row.is-expanded .awards-toggle-caption { color: var(--aw-accent); }
.awards-save-status { min-height: 16px; margin-top: 5px; font-size: 11px; color: var(--aw-muted); }
.awards-save-status.is-saving { color: #946200; }
.awards-save-status.is-saved { color: var(--aw-green); }
.awards-save-status.is-error { color: var(--aw-danger); }

.awards-stats-cell strong { display: inline-block; font-size: 16px; margin-right: 3px; }
.awards-stats-cell span { display: block; color: var(--aw-muted); font-size: 11px; margin-top: 2px; }

.awards-control {
    width: 100%;
    min-height: 34px;
    border: 1px solid #ccd5dd;
    border-radius: 6px;
    padding: 5px 7px;
    background: #fff;
    color: var(--aw-text);
}
.awards-control-hint { margin-top: 4px; color: var(--aw-muted); font-size: 10px; line-height: 1.3; }
.awards-na { color: #a0a9b1; }

.awards-value {
    min-width: 70px;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    vertical-align: middle !important;
}
.awards-empty { text-align: center; color: var(--aw-muted); padding: 24px !important; }

/* Override switch: full-width, aligned text and switch. */
.awards-override-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    max-width: 230px;
    margin-top: 9px;
    padding: 7px 8px 7px 10px;
    border: 1px solid #d2d9df;
    border-radius: 8px;
    background: #f7f9fa;
    color: #687582;
    font-size: 10px;
    line-height: 1.25;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}
.awards-override-text { flex: 1 1 auto; min-width: 0; }
.awards-override-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.awards-override-box {
    width: 34px;
    height: 19px;
    flex: 0 0 34px;
    border-radius: 11px;
    background: #c8d0d7;
    position: relative;
    transition: .15s ease;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}
.awards-override-box:after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.18);
    transition: .15s ease;
}
.awards-override-toggle.is-active {
    border-color: #d4b569;
    background: #fff8e7;
    color: #725000;
}
.awards-override-toggle.is-active .awards-override-box { background: #c58b19; }
.awards-override-toggle.is-active .awards-override-box:after { left: 17px; }

/* Award everybody */
.awards-all-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    margin-bottom: 9px;
    padding: 8px 10px;
    border: 2px solid #cbd5dd;
    border-radius: 8px;
    background: #fff;
    color: #364653;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
    transition: .15s ease;
}
.awards-all-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.awards-all-toggle-box {
    width: 34px;
    height: 20px;
    flex: 0 0 34px;
    border-radius: 11px;
    background: #b9c4cd;
    position: relative;
    transition: .15s ease;
}
.awards-all-toggle-box:after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: #fff;
    transition: .15s ease;
}
.awards-all-toggle.is-active { border-color: #62a481; background: #eef9f3; color: #16613e; }
.awards-all-toggle.is-active .awards-all-toggle-box { background: #2f8a5e; }
.awards-all-toggle.is-active .awards-all-toggle-box:after { left: 16px; }

/* Inherited rows are visibly inactive. */
.awards-row.is-settings-disabled .awards-setting-cell { background: #f5f6f7; }
.awards-row.is-settings-disabled .awards-setting-cell .awards-control,
.awards-row.is-settings-disabled .awards-setting-cell input[type="number"] {
    background: #eceff1 !important;
    border-color: #d9dee2 !important;
    color: #9ba4ac !important;
    cursor: not-allowed;
}
.awards-row.is-settings-disabled .awards-control-hint { color: #a5adb4; }
.awards-row.is-settings-disabled .awards-mode-option span {
    background: #eceff1 !important;
    border-color: #d9dee2 !important;
    color: #a0a8af !important;
    box-shadow: none !important;
}
.awards-row.is-settings-disabled .awards-all-toggle,
.awards-all-toggle.is-control-disabled {
    border-color: #dde2e6 !important;
    background: #eff1f3 !important;
    color: #a0a8af !important;
    cursor: not-allowed;
    opacity: .72;
}
.awards-row.is-settings-disabled .awards-all-toggle-box,
.awards-all-toggle.is-control-disabled .awards-all-toggle-box { background: #d2d7dc !important; }
.awards-row.is-settings-disabled .awards-all-toggle-box:after,
.awards-all-toggle.is-control-disabled .awards-all-toggle-box:after { left: 2px !important; background: #f7f7f7; }

.awards-depth-settings { transition: opacity .15s ease; }
.awards-depth-settings.is-disabled { opacity: .48; pointer-events: none; }

.awards-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 8px; }
.awards-mode-option { display: block; cursor: pointer; }
.awards-mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.awards-mode-option span {
    display: block;
    padding: 6px 7px;
    border: 1px solid #ccd5dd;
    border-radius: 6px;
    background: #fff;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
}
.awards-mode-option input:checked + span { border-color: var(--aw-accent); background: var(--aw-accent-soft); color: var(--aw-accent); }
.awards-mode-option input:disabled + span { cursor: not-allowed; }

.awards-number-field { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 700; }
.awards-number-field input { width: 70px; height: 31px; border: 1px solid #ccd5dd; border-radius: 5px; padding: 3px 6px; text-align: center; }
.awards-number-field-wide input { width: 82px; }
.awards-threshold-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 7px; }
.awards-threshold-grid .awards-number-field { display: block; }
.awards-threshold-grid .awards-number-field span { display: block; min-height: 28px; margin-bottom: 4px; font-size: 10px; line-height: 1.25; }
.awards-threshold-grid .awards-number-field input { width: 100%; }
.awards-fixed-panel.is-hidden,
.awards-threshold-panel.is-hidden { display: none; }

/* Summary */
.awards-summary-section { margin-top: 18px; margin-bottom: 0; }
.awards-summary-section h3 { margin: 0 0 9px; font-size: 17px; }
.awards-summary-grid { display: grid; grid-template-columns: repeat(4,minmax(190px,1fr)); gap: 10px; }
.awards-summary-block { border: 1px solid var(--aw-border); border-radius: 9px; background: #fff; padding: 12px 13px; min-width: 0; }
.awards-summary-block h4 { margin: 0 0 8px; font-size: 14px; }
.awards-summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.awards-summary-line span { min-width: 0; overflow-wrap: anywhere; }
.awards-summary-line strong { white-space: nowrap; }
.awards-summary-total { border-top: 1px solid var(--aw-border); margin-top: 5px; padding-top: 7px; }
.awards-summary-empty { color: var(--aw-muted); font-size: 12px; padding: 3px 0 7px; }
.awards-category-summary { max-height: 160px; overflow: auto; }

@media (max-width:1100px) { .awards-summary-grid { grid-template-columns: repeat(2,minmax(190px,1fr)); } }
@media (max-width:650px) {
    .awards-page-header { flex-direction: column; }
    .awards-summary-grid { grid-template-columns: 1fr; }
    .awards-save-all { width: 100%; }
}
