* {
    box-sizing: border-box;
}

:root {
    --app-max-width: 1380px;
    --app-radius: 0.72rem;
    --app-card-pad: 12px;
    --app-border: #d6e2d9;
    --app-text: #1f2937;
    --app-muted: #5b6675;
}

body,
body.bg-body-tertiary {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.94rem;
    line-height: 1.35;
    background: linear-gradient(180deg, #edf7ef 0%, #f4fbf5 48%, #edf7ef 100%);
    color: var(--app-text);
}

a {
    color: #0b4ea2;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(var(--app-max-width), 100%);
    max-width: none !important;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
}

.container-fluid {
    width: min(var(--app-max-width), 100%);
    max-width: none !important;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
}

main.container,
main.container-fluid {
    padding-top: 0.65rem;
    padding-bottom: 1.1rem;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

.card {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    padding: var(--app-card-pad);
    margin-bottom: 12px;
    box-shadow: 0 0.125rem 0.5rem rgba(20, 58, 35, 0.08);
}

.card h2,
.card h3 {
    margin-top: 0;
    margin-bottom: 0.65rem;
    line-height: 1.2;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.stat-card p {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #0b4ea2;
}

.dashboard-welcome-card {
    background: linear-gradient(135deg, #0b4ea2 0%, #1d65c1 70%, #2f73ca 100%);
    border: none;
    color: #fff;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.dashboard-welcome-card::after {
    content: "";
    position: absolute;
    top: -42px;
    right: -70px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.dashboard-welcome-content {
    position: relative;
    z-index: 1;
    flex: 1 1 68%;
    min-width: 320px;
    max-width: 920px;
}

.dashboard-welcome-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
}

.dashboard-welcome-note {
    margin: 0 0 6px;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.86);
    font-weight: 700;
}

.dashboard-welcome-name {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.2;
}

.dashboard-welcome-meta {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.dashboard-welcome-side {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.dashboard-welcome-side-panel {
    flex: 0 0 280px;
    max-width: 280px;
}

.dashboard-pill {
    display: inline-block;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
}

.dashboard-quick-card {
    margin-bottom: 10px;
    padding: 10px 12px;
}

.dashboard-insight-card {
    padding: 10px 12px;
}

.dashboard-insight-card table td,
.dashboard-insight-card table th {
    white-space: normal;
}

.dashboard-quick-title {
    margin: 0 0 6px;
    font-size: 0.84rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #3b4b66;
}

.dashboard-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dashboard-quick-link {
    display: inline-block;
    border: 1px solid #cbd7e8;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #174385;
    background: #f5f9ff;
}

.dashboard-quick-link:hover {
    background: #e9f2ff;
    text-decoration: none;
}

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.dashboard-stat-card {
    margin-bottom: 0;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #d7e0ed;
    position: relative;
}

.dashboard-stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 3px;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(90deg, #0b4ea2, #2f73ca);
}

.dashboard-stat-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-stat-header h3 {
    margin: 0;
    font-size: 1.02rem;
    color: #183153;
}

.dashboard-stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dashboard-stat-icon svg {
    width: 18px;
    height: 18px;
}

.dashboard-icon-schools {
    background: #e6f0ff;
    color: #1e4fa5;
}

.dashboard-icon-categories {
    background: #ebf9ee;
    color: #1f7a3f;
}

.dashboard-icon-projects {
    background: #fff3e8;
    color: #b45309;
}

.dashboard-icon-presenters {
    background: #f2ecff;
    color: #5b21b6;
}

.dashboard-icon-scored {
    background: #eaf9f7;
    color: #0f766e;
}

.dashboard-stat-value {
    margin: 8px 0 0;
    font-size: 1.64rem;
    font-weight: 800;
    color: #0b4ea2;
}

.dashboard-stat-caption {
    margin: 3px 0 0;
    color: #60718d;
    font-size: 0.88rem;
}

.dashboard-page {
    display: grid;
    gap: 10px;
}

.dashboard-head-card {
    background: linear-gradient(130deg, #0b4ea2 0%, #1f66c2 75%, #2f7bcf 100%);
    padding: 10px 12px;
}

.dashboard-head-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.dashboard-head-main {
    min-width: 240px;
}

.dashboard-head-title {
    margin: 0;
    font-size: 1.32rem;
    line-height: 1.2;
    color: #fff;
}

.dashboard-head-meta {
    margin: 4px 0 0;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.92);
}

.dashboard-meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.dashboard-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.1;
}

.dashboard-chip.is-good {
    background: rgba(22, 163, 74, 0.22);
    border-color: rgba(22, 163, 74, 0.45);
}

.dashboard-chip.is-warn {
    background: rgba(217, 119, 6, 0.22);
    border-color: rgba(217, 119, 6, 0.45);
}

.dashboard-progress-row {
    margin-top: 7px;
}

.dashboard-progress-row .progress {
    height: 7px;
}

.dashboard-action-card {
    padding: 8px 10px;
}

.dashboard-action-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.dashboard-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dashboard-inline-alert {
    margin-top: 8px;
    padding: 0.35rem 0.55rem;
    font-size: 0.84rem;
}

.dashboard-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
}

.dashboard-stat-card-compact {
    padding: 8px;
}

.dashboard-panel-title {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 7px;
    margin-bottom: 7px;
}

.dashboard-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.dashboard-table-wrap {
    border: 1px solid #d8e4db;
    border-radius: 0.58rem;
    overflow: hidden;
}

.dashboard-table-wrap table {
    border: 0;
    margin: 0;
}

.dashboard-table th,
.dashboard-table td {
    font-size: 0.89rem;
    padding: 6px 6px;
}

.layout-two {
    display: grid;
    grid-template-columns: minmax(260px, 340px) 1fr;
    gap: 12px;
}

.form-grid {
    display: grid;
    gap: 10px;
}

label {
    display: grid;
    gap: 4px;
    font-weight: 600;
    margin-bottom: 0;
}

input,
select,
textarea,
button {
    font: inherit;
}

input:not([type="hidden"]),
textarea {
    width: 100%;
    min-height: 36px;
    padding: 7px 9px;
    background-color: #ffffff;
    border: 1px solid #9fc2aa;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.form-control {
    background-color: #ffffff;
    border-color: #9fc2aa;
}

select,
.form-select {
    background-color: #eef9f1;
    border-color: #9fc2aa;
    min-height: 36px;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 0.9rem;
}

input::placeholder,
textarea::placeholder {
    color: #64748b;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
    border-color: #4f9a64;
    box-shadow: 0 0 0 0.2rem rgba(79, 154, 100, 0.2);
}

input:focus,
textarea:focus,
.form-control:focus {
    background-color: #ffffff;
}

select:focus,
.form-select:focus {
    background-color: #f4fdf6;
}

textarea {
    resize: vertical;
}

.btn {
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.5rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.87rem;
    line-height: 1.2;
}

.btn-sm {
    padding: 0.22rem 0.5rem;
    font-size: 0.78rem;
}

.alert {
    margin-bottom: 10px;
    padding: 0.5rem 0.7rem;
}

.alert-success {
    background: #d8f0df;
    color: #155724;
    border: 1px solid #a4d9b2;
}

.alert-error {
    background: #f9dfdf;
    color: #7d1d1d;
    border: 1px solid #efbcbc;
}

.muted {
    color: var(--app-muted);
    font-size: 0.86rem;
}

.compact-row {
    margin-bottom: 4px;
}

.level-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px;
}

.level-tab {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid #c7d2e0;
    border-radius: 999px;
    background: #f7f9fc;
    color: #1f2937;
    font-weight: 600;
    font-size: 0.84rem;
    line-height: 1;
    text-decoration: none;
}

.level-tab:hover {
    background: #edf2fb;
    text-decoration: none;
}

.level-tab.active {
    background: #0b4ea2;
    color: #fff;
    border-color: #0b4ea2;
}

.auth-card {
    width: 100%;
    max-width: 100%;
    margin: 10px 0;
}

.auth-brand {
    text-align: center;
    margin-bottom: 8px;
}

.auth-logo {
    max-width: 88px;
    width: 100%;
    height: auto;
    display: inline-block;
}

.auth-event-title {
    margin: 6px 0 0;
    font-weight: 800;
    letter-spacing: 0.2px;
    font-size: 0.86rem;
    color: #183153;
}

.login-layout {
    width: 100%;
    padding: 2px 0 10px;
}

.login-split-card {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    border-radius: 0.8rem;
}

.login-split-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(360px, 500px);
    align-items: stretch;
}

.login-hero-panel {
    background: linear-gradient(145deg, #135c9d 0%, #1f6fb8 58%, #3b86cc 100%);
    color: #fff;
    padding: 24px 24px 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-hero-panel::after {
    content: "";
    position: absolute;
    right: -54px;
    top: -48px;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.login-hero-brand {
    text-align: left;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.login-hero-brand .auth-event-title {
    color: rgba(255, 255, 255, 0.9);
}

.login-hero-title {
    margin: 0;
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    line-height: 1.12;
    letter-spacing: 0.2px;
    max-width: 18ch;
    position: relative;
    z-index: 1;
}

.login-hero-subtitle {
    margin: 8px 0 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.92);
    max-width: 52ch;
    position: relative;
    z-index: 1;
}

.login-hero-tags {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.login-hero-tag {
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.74rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.login-form-panel {
    background: #ffffff;
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form-grid {
    gap: 8px;
}

.login-actions {
    margin-top: 2px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.login-default-users {
    margin: 8px 0 0;
    font-size: 0.78rem;
    line-height: 1.35;
}

.login-mobile-brand {
    display: none;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #cfdbd2;
    font-size: 0.88rem;
}

tbody tr:nth-child(odd) {
    background: #ffffff;
}

tbody tr:nth-child(even) {
    background: #f7fcf8;
}

tbody tr:hover {
    background: #edf8ef;
}

th,
td {
    border: 1px solid #d1dfd4;
    padding: 7px 6px;
    text-align: left;
    white-space: nowrap;
    vertical-align: middle;
}

.table > :not(caption) > * > * {
    border: 1px solid #d1dfd4;
}

th {
    background: #f2f8f3;
    font-weight: 700;
    font-size: 0.84rem;
}

.inline-form {
    display: inline;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    z-index: 1000;
}

.modal-card {
    width: min(520px, 100%);
    max-height: 76vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #d7dee7;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.modal-header h3 {
    margin: 0;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.modal-note {
    margin-top: 0;
    font-size: 0.84rem;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1fr;
    gap: 6px;
    align-items: end;
}

.modal-field {
    display: grid;
    gap: 3px;
    margin: 0;
    font-size: 0.82rem;
}

.modal-field-judge {
    min-width: 150px;
}

.modal-form input {
    padding: 6px 7px;
    min-height: 32px;
    font-size: 0.86rem;
}

.modal-card table th,
.modal-card table td {
    padding: 6px 5px;
    font-size: 0.82rem;
}

.score-category-title {
    margin: 10px 0 6px;
}

.score-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
    margin-bottom: 8px;
}

.projects-page {
    display: grid;
    gap: 9px;
}

.project-hero-card {
    border: none;
    background: linear-gradient(142deg, #0f4fa2 0%, #1f66c2 72%, #2d78cc 100%);
    color: #fff;
    padding: 4px 8px;
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
    min-height: 0;
    height: auto;
}

.project-hero-card::after {
    content: "";
    position: absolute;
    top: -38px;
    right: -30px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.project-hero-row {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    width: 100%;
    white-space: nowrap;
    overflow-x: auto;
}

.project-hero-label {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.86);
    padding-right: 2px;
}

.project-hero-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 0.7rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.project-hero-pill.is-active {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.62);
}

.project-hero-pill.is-muted {
    background: rgba(148, 163, 184, 0.24);
    border-color: rgba(203, 213, 225, 0.6);
}

.project-filter-card {
    padding-bottom: 10px;
}

.project-filter-form {
    display: grid;
    gap: 8px;
    align-items: end;
}

.project-filter-form.is-admin {
    grid-template-columns: minmax(150px, 200px) minmax(220px, 1fr) auto;
}

.project-filter-form.is-school {
    grid-template-columns: minmax(220px, 1fr) auto;
}

.project-filter-field {
    min-width: 0;
}

.project-filter-field-wide {
    min-width: 0;
}

.project-filter-field select {
    min-height: 35px;
}

.project-filter-actions {
    display: flex;
    align-items: end;
}

.project-list-card,
.project-entry-card {
    border-radius: 12px;
}

.project-section-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.project-section-title {
    margin: 0;
    font-size: 1.08rem;
}

.project-summary-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 7px 0 0;
}

.project-summary-pill {
    display: inline-block;
    border-radius: 999px;
    border: 1px solid #d3deee;
    background: #eef4fc;
    color: #264670;
    padding: 4px 8px;
    font-size: 0.78rem;
    font-weight: 700;
}

.project-summary-pill.is-active {
    border-color: #9cc9ac;
    background: #eaf8ee;
    color: #1f5134;
}

.project-summary-pill.is-good {
    border-color: #8fd0aa;
    background: #e4f8ec;
    color: #13623a;
}

.project-summary-pill.is-muted {
    border-color: #d3deee;
    background: #eef2f7;
    color: #4a5a71;
}

.project-list-table th {
    background: #eef7f0;
    font-size: 0.82rem;
}

.project-list-table td {
    font-size: 0.84rem;
}

.project-presenters {
    display: grid;
    gap: 3px;
}

.project-presenter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.project-action-cell {
    min-width: 140px;
}

.project-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.project-entry-table th {
    background: #eef7f0;
    font-size: 0.8rem;
}

.project-entry-table input,
.project-entry-table select {
    min-width: 128px;
    padding: 6px 7px;
}

.project-row-number {
    font-weight: 700;
    color: #3d4f6a;
}

.project-entry-table .remove-project-row {
    min-width: 70px;
}

.project-entry-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.result-category-title {
    margin: 10px 0 6px;
}

.report-header-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    align-items: end;
}

.report-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
}

.report-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
}

.report-export-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
}

.report-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 10px;
}

.report-stat {
    background: #edf2fb;
    border: 1px solid #d2def3;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #183153;
}

.print-only {
    display: none;
}

.report-print-brand {
    text-align: center;
    margin-bottom: 8px;
}

.report-print-logo {
    max-width: 110px;
    width: 100%;
    height: auto;
}

.report-print-title {
    margin: 4px 0 0;
    font-weight: 800;
    letter-spacing: 0.2px;
    font-size: 0.86rem;
    color: #183153;
}

.rank-badge {
    display: inline-block;
    min-width: 24px;
    text-align: center;
    border-radius: 999px;
    padding: 1px 6px;
    font-weight: 700;
    background: #e5e7eb;
    color: #1f2937;
}

.rank-1 {
    background: #fef3c7;
    color: #92400e;
}

.rank-2 {
    background: #e2e8f0;
    color: #334155;
}

.rank-3 {
    background: #fde3cf;
    color: #9a3412;
}

.navbar {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

.navbar .navbar-brand {
    font-size: 1rem;
    letter-spacing: 0.1px;
}

.navbar .nav-link {
    padding: 0.32rem 0.5rem !important;
    font-size: 0.88rem;
}

.navbar .navbar-text {
    font-size: 0.78rem !important;
}

@media (max-width: 900px) {
    .layout-two {
        grid-template-columns: 1fr;
    }

    .dashboard-welcome-name {
        font-size: 1.45rem;
    }

    .dashboard-welcome-side {
        width: 100%;
        align-items: flex-start;
    }

    .dashboard-welcome-content {
        min-width: 0;
        max-width: 100%;
    }

    .dashboard-welcome-side-panel {
        flex-basis: auto;
        max-width: 100%;
    }

    .dashboard-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    }

    .modal-form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .modal-field-judge {
        grid-column: 1 / -1;
    }

    .report-filter-form label {
        width: 100%;
    }

    .report-export-form label {
        width: 100%;
    }

    .score-filter-form label {
        width: 100%;
    }

    .project-filter-form label {
        width: 100%;
    }

    .report-toolbar {
        width: 100%;
        align-items: stretch;
    }

    .report-toolbar > form {
        width: 100%;
    }

    .project-hero-row {
        flex-wrap: wrap;
        white-space: normal;
        overflow-x: visible;
        width: 100%;
    }

    .project-filter-form {
        grid-template-columns: 1fr;
    }

    .login-split-grid {
        grid-template-columns: 1fr;
    }

    .login-hero-panel {
        padding: 16px 14px 14px;
    }

    .login-hero-title {
        max-width: 100%;
        font-size: 1.35rem;
    }

    .login-form-panel {
        padding: 14px;
    }

    .table-wrap table {
        min-width: 560px;
    }

    .dashboard-head-main {
        min-width: 0;
    }

    .dashboard-meta-chips {
        justify-content: flex-start;
    }

    .dashboard-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }
}

@media (max-width: 576px) {
    body,
    body.bg-body-tertiary {
        font-size: 0.95rem;
    }

    main.container {
        padding-top: 0.75rem;
        padding-bottom: 1rem;
    }

    .card {
        padding: 9px;
        border-radius: 0.62rem;
        margin-bottom: 9px;
    }

    .auth-card {
        margin: 10px auto;
    }

    .login-hero-panel {
        display: none;
    }

    .login-mobile-brand {
        display: block;
        margin-bottom: 6px;
    }

    .login-mobile-brand .auth-logo {
        max-width: 58px;
    }

    .login-mobile-brand .auth-event-title {
        margin-top: 4px;
        font-size: 0.75rem;
        letter-spacing: 0.15px;
    }

    .login-form-panel {
        padding: 10px;
    }

    .login-form-panel .mb-1 {
        margin-bottom: 0.35rem !important;
        font-size: 1rem;
    }

    .login-form-panel .mb-3 {
        display: none;
    }

    .login-actions .btn {
        width: 100%;
    }

    .login-default-users {
        display: none;
    }

    .dashboard-welcome-card {
        padding: 10px;
    }

    .dashboard-welcome-name {
        font-size: 1.1rem;
    }

    .dashboard-welcome-inline {
        gap: 6px;
    }

    .dashboard-welcome-meta {
        font-size: 0.84rem;
    }

    .dashboard-stat-value {
        margin-top: 6px;
        font-size: 1.26rem;
        line-height: 1.05;
    }

    .dashboard-stat-card {
        padding: 8px;
        border-radius: 8px;
    }

    .dashboard-stat-header {
        gap: 8px;
    }

    .dashboard-stat-header h3 {
        font-size: 0.92rem;
        line-height: 1.2;
    }

    .dashboard-stat-icon {
        width: 28px;
        height: 28px;
        border-radius: 7px;
    }

    .dashboard-stat-icon svg {
        width: 15px;
        height: 15px;
    }

    .dashboard-stat-caption {
        margin-top: 4px;
        font-size: 0.78rem;
        line-height: 1.25;
    }

    .projects-page {
        gap: 8px;
    }

    .project-hero-card {
        padding: 4px 6px;
    }

    .project-hero-label {
        font-size: 0.64rem;
    }

    .project-hero-row {
        gap: 4px;
    }

    .project-hero-pill {
        font-size: 0.66rem;
        padding: 2px 5px;
    }

    .project-section-head {
        margin-bottom: 6px;
        align-items: flex-start;
    }

    .project-section-title {
        font-size: 0.97rem;
    }

    .project-summary-pill {
        font-size: 0.72rem;
        padding: 3px 7px;
    }

    .project-list-table th,
    .project-list-table td,
    .project-entry-table th,
    .project-entry-table td {
        font-size: 0.78rem;
    }

    .project-action-cell {
        min-width: 120px;
    }

    .project-action-cell .project-action-buttons {
        width: 100%;
    }

    .level-tab {
        padding: 4px 8px;
        font-size: 0.76rem;
    }

    .table-wrap table {
        min-width: 500px;
    }

    th,
    td {
        padding: 6px 5px;
        font-size: 0.78rem;
    }

    .project-entry-table input,
    .project-entry-table select {
        min-width: 106px;
    }

    .modal-backdrop {
        padding: 6px;
    }

    .modal-card {
        width: 100%;
        max-height: 88vh;
        padding: 8px;
    }

    .modal-form-grid {
        grid-template-columns: 1fr;
    }

    .modal-field-judge {
        min-width: 0;
    }

    .modal-actions,
    .project-entry-actions {
        gap: 6px;
    }

    .modal-actions .btn,
    .project-entry-actions .btn {
        width: 100%;
    }

    .dashboard-page {
        gap: 8px;
    }

    .dashboard-head-card {
        padding: 8px 9px;
    }

    .dashboard-head-title {
        font-size: 1.1rem;
    }

    .dashboard-head-meta {
        font-size: 0.83rem;
    }

    .dashboard-chip {
        font-size: 0.77rem;
        padding: 3px 7px;
    }

    .dashboard-action-card {
        padding: 7px 8px;
    }

    .dashboard-action-group {
        width: 100%;
    }

    .dashboard-action-group .btn {
        flex: 1 1 calc(50% - 3px);
        min-width: 0;
    }

    .dashboard-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .dashboard-stat-card-compact {
        padding: 7px;
    }

    .dashboard-panel-title {
        margin-bottom: 6px;
        gap: 6px;
    }

    .dashboard-table-wrap table {
        min-width: 460px;
    }

    .dashboard-table th,
    .dashboard-table td {
        font-size: 0.81rem;
        padding: 5px 5px;
    }
}

@media print {
    body {
        background: #fff;
        color: #000;
    }

    .topbar,
    .nav,
    .navbar,
    .level-tabs,
    .report-filter-form,
    .report-export-form,
    .report-stats {
        display: none !important;
    }

    main.container {
        width: 100%;
        padding: 0;
    }

    .card {
        border: none;
        padding: 0;
        margin: 0;
    }

    .print-only {
        display: block !important;
    }

    table {
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
    }
}
