html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem #ffffff, 0 0 0 0.22rem #2b70c9;
}

html {
    min-height: 100%;
}

body {
    background: #f4f6f8;
    color: #1d2733;
    margin: 0;
    min-height: 100vh;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.app-nav {
    background: #0f3762;
    border-bottom: 1px solid #082748;
}

.app-nav .nav-link,
.app-nav .navbar-brand {
    color: #ffffff;
}

.app-nav .nav-link:hover,
.app-nav .navbar-brand:hover {
    color: #dbeafe;
}

.app-brand {
    align-items: center;
    display: inline-flex;
    font-weight: 700;
    gap: 0.65rem;
}

.brand-mark {
    align-items: center;
    background: #f6b23f;
    border-radius: 4px;
    color: #102235;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    height: 1.85rem;
    justify-content: center;
    letter-spacing: 0;
    width: 1.85rem;
}

.nav-session {
    align-items: center;
    color: #e8f1fb;
    display: flex;
    gap: 0.85rem;
}

.app-shell {
    margin: 0 auto;
    max-width: 1120px;
    padding: 2rem 1.25rem 4rem;
}

.app-footer {
    color: #667789;
    font-size: 0.88rem;
    padding: 0 1.25rem 2rem;
    text-align: center;
}

.login-page {
    align-items: center;
    display: grid;
    min-height: calc(100vh - 190px);
}

.login-panel {
    background: #ffffff;
    border: 1px solid #d8e0e8;
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(15, 35, 56, 0.12);
    margin: 0 auto;
    max-width: 430px;
    padding: 2rem;
    width: min(100%, 430px);
}

.login-brand {
    color: #18324f;
}

.login-title {
    margin: 1.25rem 0 1.5rem;
}

.login-title h1 {
    font-size: 1.55rem;
    margin: 0;
}

.login-form {
    display: grid;
    gap: 1rem;
}

.form-label {
    color: #2f3b48;
    font-weight: 650;
}

.form-control {
    border-color: #b8c4d1;
    border-radius: 6px;
}

.primary-action {
    background: #1565b3;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    font-weight: 700;
    min-height: 2.7rem;
}

.primary-action:hover {
    background: #0f5599;
    color: #ffffff;
}

.validation-summary,
.field-validation-error {
    color: #b42318;
}

.validation-summary ul {
    margin-bottom: 0;
    padding-left: 1.2rem;
}

.workspace-header {
    align-items: center;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.workspace-header h1 {
    font-size: 1.9rem;
    margin: 0;
}

.eyebrow {
    color: #627184;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin: 0 0 0.35rem;
    text-transform: uppercase;
}

.user-tile,
.module-tile {
    background: #ffffff;
    border: 1px solid #d8e0e8;
    border-radius: 8px;
}

.user-tile {
    display: grid;
    min-width: 220px;
    padding: 1rem;
}

.user-label {
    color: #627184;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

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

.module-tile {
    color: #1d2733;
    display: grid;
    min-height: 120px;
    padding: 1.2rem;
    text-decoration: none;
}

.module-tile strong {
    align-self: end;
    color: #8a5a00;
}

.module-tile.is-disabled {
    cursor: default;
    opacity: 0.72;
}

.page-heading {
    align-items: center;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

.page-heading h1 {
    font-size: 1.75rem;
    margin: 0;
}

.heading-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
}

.filter-strip {
    align-items: stretch;
    display: grid;
    gap: 0.9rem;
    grid-template-columns: minmax(220px, 1fr) 160px 210px auto;
    margin-bottom: 1rem;
}

.filter-group,
.metric-group,
.date-filter {
    background: #ffffff;
    border: 1px solid #d8e0e8;
    border-radius: 8px;
    margin: 0;
    min-height: 76px;
    padding: 0.8rem 1rem;
}

.filter-group legend,
.legend-label,
.metric-group span,
.date-filter span {
    color: #526274;
    display: block;
    font-size: 0.78rem;
    font-weight: 750;
    margin-bottom: 0.45rem;
}

.radio-option {
    align-items: center;
    display: inline-flex;
    gap: 0.35rem;
    margin-right: 1rem;
}

.radio-option.is-disabled {
    opacity: 0.55;
}

.metric-group strong {
    display: block;
    font-size: 1.45rem;
    line-height: 1.9rem;
    text-align: right;
}

.date-filter .form-control {
    min-height: 2.25rem;
}

.compact-action {
    align-self: stretch;
    min-width: 112px;
}

.primary-link-action,
.secondary-action {
    align-items: center;
    border-radius: 6px;
    display: inline-flex;
    font-weight: 700;
    justify-content: center;
    min-height: 2.45rem;
    padding: 0.5rem 0.85rem;
    text-decoration: none;
}

.primary-link-action {
    background: #1565b3;
    border: 1px solid #1565b3;
    color: #ffffff;
}

.primary-link-action:hover {
    background: #0f5599;
    color: #ffffff;
}

.secondary-action {
    background: #ffffff;
    border: 1px solid #9fb0c1;
    color: #18324f;
}

.secondary-action:hover {
    background: #edf4fb;
    color: #102235;
}

.secondary-action:disabled {
    color: #7b8794;
    cursor: default;
    opacity: 0.65;
}

.status-message {
    background: #fff7ed;
    border: 1px solid #f1b76d;
    border-radius: 8px;
    color: #7c3f00;
    font-weight: 650;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
}

.status-message.is-success {
    background: #ecfdf3;
    border-color: #8fd8ab;
    color: #05603a;
}

.listing-surface {
    background: #ffffff;
    border: 1px solid #cbd6e2;
    border-radius: 8px;
    min-height: 390px;
}

.table-wrap {
    overflow: auto;
}

.activity-table {
    border-collapse: collapse;
    font-size: 0.86rem;
    min-width: 1380px;
    width: 100%;
}

.auditor-table {
    min-width: 900px;
}

.activity-table th,
.activity-table td {
    border-bottom: 1px solid #dfe6ee;
    border-right: 1px solid #edf1f5;
    padding: 0.48rem 0.55rem;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.activity-table th {
    background: #e9eff5;
    color: #1c2f45;
    font-size: 0.76rem;
    font-weight: 800;
    position: sticky;
    top: 0;
    z-index: 1;
}

.activity-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.activity-table tbody tr:hover {
    background: #eaf3ff;
}

.numeric-cell {
    text-align: right;
}

.empty-row {
    color: #667789;
    font-weight: 650;
    padding: 2rem 1rem;
    text-align: center;
}

.action-column {
    width: 170px;
}

.row-actions {
    align-items: center;
    display: flex;
    gap: 0.45rem;
}

.row-actions form {
    margin: 0;
}

.table-action {
    background: #ffffff;
    border: 1px solid #b4c3d4;
    border-radius: 5px;
    color: #16395f;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 750;
    justify-content: center;
    line-height: 1;
    min-width: 58px;
    padding: 0.45rem 0.55rem;
    text-decoration: none;
}

.table-action:hover {
    background: #edf4fb;
    color: #102235;
}

.danger-action {
    border-color: #d79b9b;
    color: #9f1d1d;
}

.danger-action:hover {
    background: #fff1f1;
    color: #7f1515;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.auditor-filter-strip {
    grid-template-columns: minmax(340px, 1fr) 160px;
}

.segmented-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.segment-link {
    border: 1px solid #b6c4d2;
    border-radius: 999px;
    color: #18324f;
    font-size: 0.82rem;
    font-weight: 750;
    padding: 0.4rem 0.7rem;
    text-decoration: none;
}

.segment-link:hover {
    background: #edf4fb;
    color: #102235;
}

.segment-link.is-active {
    background: #18324f;
    border-color: #18324f;
    color: #ffffff;
}

.maintenance-form {
    display: grid;
    gap: 1rem;
}

.form-section {
    background: #ffffff;
    border: 1px solid #d8e0e8;
    border-radius: 8px;
    padding: 1.1rem;
}

.form-section h2 {
    font-size: 1rem;
    margin: 0 0 1rem;
}

.form-grid {
    display: grid;
    gap: 0.9rem 1rem;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.form-grid label {
    display: grid;
    gap: 0.35rem;
}

.form-grid label > span:first-child {
    color: #2f3b48;
    font-weight: 650;
}

.daily-form-grid {
    grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr);
}

.wide-field {
    grid-column: 1 / -1;
}

.status-field {
    background: #39e75f;
    color: #043a11;
    font-weight: 800;
    text-align: center;
}

.numeric-entry {
    text-align: right;
}

.comments-entry {
    min-height: 110px;
    resize: vertical;
}

@media (max-width: 640px) {
    .workspace-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

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

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

    .login-panel {
        padding: 1.35rem;
    }
}
