:root {
    --ink: #17211d;
    --muted: #64746d;
    --line: #d9e2dd;
    --paper: #f7faf8;
    --surface: #ffffff;
    --surface-soft: #fbfdfc;
    --accent: #0f766e;
    --accent-dark: #0b4f49;
    --accent-soft: #e3f5ef;
    --gold: #b7791f;
    --gold-soft: #fff4d8;
    --sky-soft: #e9f5ff;
    --warn: #b91c1c;
    --shadow: 0 16px 40px rgba(23, 33, 29, 0.09);
    --shadow-soft: 0 8px 24px rgba(23, 33, 29, 0.07);
    --shadow-hover: 0 14px 32px rgba(23, 33, 29, 0.11);
}

html {
    scroll-behavior: smooth;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

* {
    box-sizing: border-box;
    min-width: 0;
}

body {
    margin: 0;
    overflow-x: hidden;
    width: 100%;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(183, 121, 31, 0.08) 48%, rgba(233, 245, 255, 0.9)),
        var(--paper);
    color: var(--ink);
    font-family: Tahoma, Arial, sans-serif;
    line-height: 1.7;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--accent-dark);
    text-decoration: none;
}

.skip-link {
    position: fixed;
    inset-inline-start: 16px;
    top: 10px;
    z-index: 100;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--accent-dark);
    color: #fff;
    font-weight: 700;
    transform: translateY(-140%);
    transition: transform 0.18s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(240px, 520px) minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: clamp(12px, 2.6vw, 18px) clamp(14px, 4vw, 44px);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(227, 245, 239, 0.88)),
        #fff;
    border-bottom: 1px solid rgba(15, 118, 110, 0.14);
    box-shadow: 0 10px 28px rgba(23, 33, 29, 0.08);
    backdrop-filter: blur(14px);
}

.topbar::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
}

.topbar::after {
    content: "";
    position: absolute;
    inset-inline-end: clamp(18px, 5vw, 62px);
    bottom: -46px;
    width: min(210px, 30vw);
    aspect-ratio: 1;
    border: 1px solid rgba(15, 118, 110, 0.12);
    border-radius: 8px;
    background: rgba(15, 118, 110, 0.05);
    transform: rotate(-6deg);
    pointer-events: none;
}

.brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    padding: 8px 16px 10px;
    border: 1px solid rgba(15, 118, 110, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-soft);
    font-weight: 700;
    text-align: center;
    font-size: clamp(1rem, 2vw, 1.34rem);
    line-height: 1.35;
    overflow-wrap: anywhere;
    background-image: linear-gradient(120deg, var(--accent-dark) 0%, var(--accent) 55%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-color: rgba(255, 255, 255, 0.78);
    letter-spacing: 0;
}

.quick-nav {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.quick-nav .button {
    min-width: 112px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--accent-dark);
    border: 1px solid #b7d9d1;
    box-shadow: none;
}

.quick-nav .button.active {
    background: var(--accent-dark);
    color: #fff;
    border-color: var(--accent-dark);
    box-shadow: 0 10px 22px rgba(15, 118, 110, 0.16);
}

.logout-form {
    margin: 0;
}

.page {
    width: min(1240px, 100%);
    margin: 0 auto;
    padding: 26px clamp(14px, 4vw, 34px) 88px;
}

.hero,
.result-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    padding: clamp(18px, 4vw, 32px);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(227, 245, 239, 0.92)),
        var(--accent-soft);
    border: 1px solid #c6ded6;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.dashboard-hero .button {
    flex-shrink: 0;
}

.hero::before,
.result-hero::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 7px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent), var(--gold));
}

.hero h1,
.result-hero h1 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 2.2rem);
    background: linear-gradient(120deg, var(--accent-dark) 0%, var(--accent) 55%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0;
    line-height: 1.25;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    padding: 4px 12px 4px 10px;
    border-radius: 20px;
    background: linear-gradient(90deg, var(--accent-soft), var(--gold-soft));
    border: 1px solid rgba(15, 118, 110, 0.18);
    color: var(--accent-dark);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.1);
}

.eyebrow::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    flex-shrink: 0;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.reference-number {
    margin: 8px 0 0;
    color: var(--accent-dark);
    font-weight: 700;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 9px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-align: center;
    white-space: normal;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(15, 118, 110, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.button:hover,
button:hover {
    background: var(--accent-dark);
    box-shadow: 0 12px 26px rgba(15, 118, 110, 0.22);
    transform: translateY(-1px);
}

.button.secondary {
    background: #fff;
    color: var(--accent-dark);
    border: 1px solid #b7d9d1;
    box-shadow: none;
}

.button.secondary:hover {
    background: var(--accent-soft);
    box-shadow: 0 8px 18px rgba(23, 33, 29, 0.08);
}

.button:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(183, 121, 31, 0.32);
    outline-offset: 2px;
}

.button.small {
    min-height: 38px;
    padding: 6px 12px;
}

.panel,
.filters {
    margin-bottom: 20px;
    padding: clamp(16px, 4vw, 24px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.panel,
.filters,
.stats article,
.score-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.panel:hover,
.filters:hover,
.stats article:hover,
.score-card:hover {
    box-shadow: var(--shadow-hover);
}

.stats article:hover,
.score-card:hover {
    transform: translateY(-2px);
}

.panel,
.section-box {
    content-visibility: auto;
    contain-intrinsic-size: auto 420px;
}

.panel h2,
.panel > h2 {
    margin-top: 0;
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    color: var(--accent-dark);
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--accent), var(--gold), transparent) 1;
    letter-spacing: 0;
}

.dashboard-filters {
    align-items: end;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    border-color: rgba(15, 118, 110, 0.18);
    background: rgba(255, 255, 255, 0.94);
}

.filters {
    align-items: end;
}

.management-actions {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 16px;
}

.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.grid,
.filters,
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

select {
    cursor: pointer;
}

input,
select,
textarea,
.button,
button {
    max-width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.11);
    outline: 0;
}

.compact-field {
    max-width: 360px;
    min-height: 34px;
    padding-top: 5px;
    padding-bottom: 5px;
}

textarea {
    resize: vertical;
}

.location-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.location-link {
    display: none;
    width: max-content;
    font-weight: 700;
}

.location-link.visible {
    display: inline-flex;
}

.field-help {
    color: var(--muted);
    font-weight: 400;
}

.team-builder {
    display: grid;
    gap: 10px;
}

.team-builder-label {
    font-weight: 700;
}

.team-members {
    display: grid;
    gap: 8px;
}

.team-member-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.add-team-member {
    justify-self: start;
}

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

.stats article,
.score-card {
    position: relative;
    overflow: hidden;
    min-height: 118px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.stats article::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: var(--accent);
}

.stat-card.primary::before {
    background: var(--accent-dark);
}

.stat-card.success::before {
    background: #16a34a;
}

.stat-card.warning::before {
    background: var(--gold);
}

.stat-card.danger::before {
    background: var(--warn);
}

.stats article:nth-child(2n),
.score-card {
    background: linear-gradient(135deg, #fff, var(--sky-soft));
}

.stats article:nth-child(3n) {
    background: linear-gradient(135deg, #fff, var(--gold-soft));
}

.stats span,
.score-card span,
.details-grid dt {
    color: var(--muted);
    font-size: 0.92rem;
}

.stats strong,
.score-card strong {
    display: block;
    margin-top: 4px;
    font-size: clamp(1.45rem, 3vw, 1.9rem);
    letter-spacing: 0;
    line-height: 1.15;
}

.dashboard-kpis-panel {
    display: grid;
    gap: 14px;
}

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

.grade-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(135deg, #fff, #f7fbf9);
}

.grade-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.grade-header strong {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 1.05rem;
}

.grade-header span {
    color: var(--muted);
    font-weight: 700;
}

.grade-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--ink);
    font-weight: 700;
}

.grade-progress {
    height: 9px;
}

.grade-a .grade-progress span {
    background: linear-gradient(90deg, #166534, #22c55e);
}

.grade-b .grade-progress span {
    background: linear-gradient(90deg, #1d4ed8, #38bdf8);
}

.grade-c .grade-progress span {
    background: linear-gradient(90deg, #a16207, #f59e0b);
}

.grade-d .grade-progress span {
    background: linear-gradient(90deg, #b91c1c, #ef4444);
}

.performance-chart {
    display: grid;
    gap: 10px;
}

.performance-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 2fr) auto;
    align-items: center;
    gap: 10px;
}

.performance-name {
    font-weight: 700;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.performance-track {
    height: 12px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    overflow: hidden;
}

.performance-bar {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    transition: width 0.25s ease;
}

.performance-value {
    min-width: 58px;
    text-align: left;
    color: var(--accent-dark);
}

.empty-state-text {
    margin: 0;
    padding: 12px;
    border: 1px dashed #b7d9d1;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 700;
    background: #fbfdfc;
}

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

.chart-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    min-height: 320px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(135deg, #fff, #f7fbf9);
    overflow: hidden;
}

.chart-card,
.grade-card {
    box-shadow: 0 6px 18px rgba(23, 33, 29, 0.045);
}

.chart-card h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--accent-dark);
}

.chart-frame {
    position: relative;
    width: 100%;
    height: 250px;
    min-width: 0;
    overflow: hidden;
}

.chart-card canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
}

.chart-card-wide {
    grid-column: 1 / -1;
}

.brand-text {
    background-image: linear-gradient(120deg, var(--accent-dark) 0%, var(--accent) 55%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.oman-emblem {
    display: block;
    flex: 0 0 auto;
    object-fit: contain;
}

.brand-emblem {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 6px 10px rgba(23, 33, 29, 0.12));
}

.rating-card {
    border-color: currentColor;
}

.rating-stat {
    border-color: currentColor;
}

.rating-card span,
.rating-card strong,
.rating-stat span,
.rating-stat strong {
    color: inherit;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-title > span {
    color: var(--muted);
    font-weight: 700;
}

.section-title h2 {
    margin: 0;
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    color: var(--accent-dark);
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--accent), var(--gold), transparent) 1;
    letter-spacing: 0;
}

.workflow-progress {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid #b7d9d1;
    border-radius: 8px;
    background: linear-gradient(135deg, #fff, var(--accent-soft));
}

.workflow-progress-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.workflow-progress-main strong {
    color: var(--accent-dark);
    font-size: 1.25rem;
}

.workflow-progress-main span,
.sticky-progress {
    color: var(--muted);
    font-weight: 700;
}

.progress-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
}

.progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    transition: width 0.2s ease;
}

.workflow-progress-actions,
.section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.section-actions {
    padding: 12px 14px 0;
}

.section-box {
    margin: 12px 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(23, 33, 29, 0.05);
}

.section-box summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    font-weight: 700;
    background: linear-gradient(90deg, rgba(227, 245, 239, 0.8), rgba(255, 255, 255, 0.85));
    line-height: 1.45;
}

.section-box summary::-webkit-details-marker {
    display: none;
}

.section-box summary::before {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: #fff;
    color: var(--accent-dark);
    border: 1px solid #b7d9d1;
    flex-shrink: 0;
}

.section-box[open] summary::before {
    content: "-";
}

.section-box small {
    color: var(--muted);
}

.items {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.item-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 12px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(23, 33, 29, 0.05);
}

.item-card:focus-within {
    border-color: rgba(15, 118, 110, 0.45);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
}

.item-card.is-missing {
    border-color: #fecaca;
    background: #fffafa;
}

.item-text {
    display: grid;
    gap: 6px;
}

.critical {
    display: inline-flex;
    width: max-content;
    padding: 2px 8px;
    border-radius: 8px;
    background: #fee2e2;
    color: var(--warn);
    font-size: 0.82rem;
    font-weight: 700;
}

.status-options ul,
.status-options > div {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.status-options label,
.status-options > div > div label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 7px 9px;
    border: 1px solid rgba(217, 226, 221, 0.9);
    border-radius: 8px;
    background: #fbfdfc;
    font-weight: 400;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.status-options label:has(input:checked),
.status-options > div > div label:has(input:checked) {
    border-color: rgba(15, 118, 110, 0.45);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.08);
}

.status-options input {
    width: 18px;
    min-height: 18px;
}

.notes-field {
    display: none;
    grid-column: 1 / -1;
}

.notes-field.visible {
    display: grid;
}

.section-notes-field,
.section-note-display {
    display: grid;
    gap: 6px;
    margin: 0 14px 14px;
    padding: 14px;
    border: 1px dashed #b7d9d1;
    border-radius: 8px;
    background: #fff;
}

.section-note-display {
    color: var(--ink);
}

.section-note-display p {
    margin: 0;
    color: var(--ink);
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    background: linear-gradient(180deg, rgba(247, 250, 248, 0), var(--paper) 35%);
}

.sticky-progress {
    margin-inline-end: auto;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
}

.topbar-user {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    vertical-align: top;
    overflow-wrap: anywhere;
}

th {
    color: var(--muted);
    font-weight: 700;
    background: linear-gradient(180deg, #f7fbf9, #eef7f3);
    white-space: nowrap;
}

tbody tr:nth-child(even) {
    background: rgba(233, 245, 255, 0.45);
}

tbody tr:hover {
    background: rgba(227, 245, 239, 0.72);
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:focus-visible {
    outline: 3px solid rgba(183, 121, 31, 0.32);
    outline-offset: -3px;
}

.table-cell-link {
    display: block;
    min-height: 100%;
    color: inherit;
}

.badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 8px;
    background: #dff3ed;
    color: var(--accent-dark);
    font-weight: 700;
    line-height: 1.4;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}

.pagination span {
    color: var(--muted);
    font-weight: 700;
}

.rating-excellent {
    background: #dcfce7;
    color: #166534;
}

.rating-very_good {
    background: #dbeafe;
    color: #1d4ed8;
}

.rating-good {
    background: #fef3c7;
    color: #92400e;
}

.rating-acceptable {
    background: #ffedd5;
    color: #c2410c;
}

.rating-pending {
    background: #ede9fe;
    color: #6d28d9;
}

.rating-out_of_service {
    background: #fee2e2;
    color: #b91c1c;
}

.workflow-draft {
    background: #fef3c7;
    color: #92400e;
}

.workflow-approved {
    background: #dcfce7;
    color: #166534;
}

.score-card.rating-excellent {
    background: linear-gradient(135deg, #fff, #dcfce7);
}

.rating-stat.rating-excellent {
    background: linear-gradient(135deg, #fff, #dcfce7);
}

.score-card.rating-very_good {
    background: linear-gradient(135deg, #fff, #dbeafe);
}

.rating-stat.rating-very_good {
    background: linear-gradient(135deg, #fff, #dbeafe);
}

.score-card.rating-good {
    background: linear-gradient(135deg, #fff, #fef3c7);
}

.rating-stat.rating-good {
    background: linear-gradient(135deg, #fff, #fef3c7);
}

.score-card.rating-acceptable {
    background: linear-gradient(135deg, #fff, #ffedd5);
}

.rating-stat.rating-acceptable {
    background: linear-gradient(135deg, #fff, #ffedd5);
}

.score-card.rating-pending {
    background: linear-gradient(135deg, #fff, #ede9fe);
}

.rating-stat.rating-pending {
    background: linear-gradient(135deg, #fff, #ede9fe);
}

.score-card.rating-out_of_service {
    background: linear-gradient(135deg, #fff, #fee2e2);
}

.rating-stat.rating-out_of_service {
    background: linear-gradient(135deg, #fff, #fee2e2);
}

.details-grid {
    margin: 0;
}

.details-grid div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(135deg, #fff, #fbfdfc);
}

.details-grid dd {
    margin: 4px 0 0;
    font-weight: 700;
}

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

code {
    display: inline-block;
    direction: ltr;
    padding: 8px 10px;
    background: #edf3f0;
    border-radius: 8px;
}

.login-body {
    min-height: 100vh;
    display: grid;
    align-items: center;
    justify-items: center;
    padding-block: clamp(12px, 5vh, 42px);
    padding-inline: clamp(12px, 4vw, 42px);
    background:
        linear-gradient(120deg, rgba(15, 118, 110, 0.08) 0 18%, transparent 18% 100%),
        linear-gradient(300deg, rgba(184, 134, 11, 0.1) 0 14%, transparent 14% 100%),
        linear-gradient(180deg, #f7faf8, #eef7f3);
}

.login-page {
    width: min(100%, clamp(20rem, 42vw, 34rem));
    display: grid;
    gap: clamp(12px, 3vw, 16px);
}

.login-title {
    position: relative;
    overflow: hidden;
    min-height: clamp(82px, 14vh, 112px);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: clamp(14px, 3.4vw, 26px);
    border: 1px solid rgba(15, 118, 110, 0.14);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(227, 245, 239, 0.82)),
        #fff;
    box-shadow: var(--shadow);
}

.login-title::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
}

.login-title::after {
    content: "";
    position: absolute;
    inset-inline-end: clamp(16px, 4vw, 36px);
    bottom: -36px;
    width: min(150px, 36%);
    aspect-ratio: 1;
    border: 1px solid rgba(15, 118, 110, 0.14);
    border-radius: 8px;
    background: rgba(15, 118, 110, 0.06);
    transform: rotate(-6deg);
}

.login-title h1 {
    position: relative;
    z-index: 1;
    max-width: 420px;
    margin: 0;
    font-size: clamp(1.15rem, 2.4vw, 1.55rem);
    line-height: 1.35;
    text-align: center;
    overflow-wrap: anywhere;
    background: linear-gradient(120deg, var(--accent-dark) 0%, var(--accent) 60%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0;
}

.login-emblem {
    position: relative;
    z-index: 1;
    width: clamp(58px, 12vw, 78px);
    height: clamp(58px, 12vw, 78px);
    justify-self: center;
    filter: drop-shadow(0 10px 16px rgba(23, 33, 29, 0.13));
}

.login-panel {
    width: 100%;
    justify-self: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.login-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(18px, 4.4vw, 36px);
}

.login-panel::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
}

.login-panel-header {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
    text-align: center;
}

.login-mark {
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.22);
}

.login-panel h2 {
    margin: 0;
    font-size: 1.7rem;
    background: linear-gradient(120deg, var(--accent-dark), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0;
}

.login-panel p {
    margin: 4px 0 0;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-form input {
    min-height: 48px;
}

.login-submit {
    width: 100%;
    min-height: 48px;
    margin-top: 4px;
}

.form-alert {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: var(--warn);
    font-weight: 700;
}

.system-messages {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.message {
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-soft);
    font-weight: 700;
}

.message::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-inline-end: 8px;
    border-radius: 50%;
    background: currentColor;
}

.message.error {
    border-color: #fecaca;
    background: #fef2f2;
    color: var(--warn);
}

.message.success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.errorlist {
    margin: 8px 0 0;
    padding: 8px 10px;
    list-style: none;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: var(--warn);
    font-size: 0.9rem;
    font-weight: 700;
}

@media (max-width: 1080px) {
    .topbar {
        grid-template-columns: 1fr;
    }

    .quick-nav {
        justify-content: center;
    }

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

@media (max-width: 760px) {
    body {
        background: var(--paper);
    }

    .topbar {
        position: static;
        grid-template-columns: 1fr;
        gap: 12px;
        padding-inline: 10px;
    }

    .topbar::after {
        display: none;
    }

    .page {
        padding-top: 14px;
        padding-inline: 10px;
        padding-bottom: 110px;
    }

    .hero,
    .result-hero,
    .section-title {
        align-items: stretch;
        flex-direction: column;
    }

    .hero,
    .result-hero,
    .panel,
    .filters {
        margin-bottom: 14px;
    }

    .hero h1,
    .result-hero h1 {
        font-size: clamp(1.22rem, 7vw, 1.58rem);
    }

    .grid,
    .filters,
    .details-grid,
    .stats {
        grid-template-columns: 1fr;
    }

    .filter-actions .button {
        flex: 1 1 150px;
    }

    .filter-actions,
    .workflow-progress-actions,
    .section-actions,
    .action-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .item-card {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .status-options ul,
    .status-options > div {
        grid-template-columns: 1fr;
    }

    .location-row {
        grid-template-columns: 1fr;
    }

    .team-member-row {
        grid-template-columns: 1fr;
    }

    .quick-nav {
        width: 100%;
        gap: 8px;
    }

    .quick-nav .button {
        min-width: 0;
        flex: 1 1 calc(50% - 8px);
        padding-inline: 10px;
    }

    .brand {
        flex-direction: column;
        gap: 8px;
    }

    .brand-emblem {
        width: 54px;
        height: 54px;
    }

    .logout-form {
        flex: 1 1 calc(50% - 8px);
    }

    .logout-form .button {
        width: 100%;
    }

    .action-row .button {
        flex: 1 1 150px;
    }

    .sticky-actions .button {
        width: 100%;
        max-width: 100%;
        white-space: normal;
    }

    .sticky-actions {
        margin-inline: -10px;
        padding: 10px;
        border-top: 1px solid rgba(15, 118, 110, 0.14);
        background: rgba(247, 250, 248, 0.96);
        backdrop-filter: blur(12px);
    }

    .sticky-progress {
        width: 100%;
        margin-inline-end: 0;
        text-align: center;
    }

    .table-wrap {
        overflow-x: visible;
    }

    table.responsive-table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0 10px;
    }

    .responsive-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .responsive-table tr {
        display: grid;
        gap: 2px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 6px 16px rgba(23, 33, 29, 0.05);
    }

    .responsive-table tbody tr:nth-child(even),
    .responsive-table tbody tr:hover {
        background: #fff;
    }

    .responsive-table td {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        padding: 8px 4px;
        border-bottom: 1px solid rgba(217, 226, 221, 0.7);
        text-align: right;
        overflow-wrap: anywhere;
    }

    .responsive-table td:last-child {
        border-bottom: 0;
    }

    .responsive-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 700;
    }

    .responsive-table td[colspan] {
        display: block;
    }

    .responsive-table td[colspan]::before {
        content: "";
    }

    .grade-distribution-grid {
        grid-template-columns: 1fr;
    }

    .performance-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

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

    .dashboard-charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-card {
        min-height: 270px;
    }

    .chart-frame {
        height: 220px;
    }

    .login-page {
        width: 100%;
    }

    .login-title {
        grid-template-columns: 1fr;
        justify-items: center;
        min-height: 96px;
    }

    .login-title h1 {
        font-size: clamp(1.55rem, 7vw, 1.9rem);
    }
}
