* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #1f2933;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    background: #172b4d;
    color: white;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nav-links a:hover {
    text-decoration: underline;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-container {
    width: min(1200px, calc(100% - 32px));
    margin: 32px auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0 0 6px;
}

.page-header p {
    margin: 0;
    color: #66788a;
}

.button {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    padding: 11px 16px;
    background: #1769aa;
    color: white;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.button:hover {
    background: #12558b;
}

.button-secondary {
    background: #e7edf3;
    color: #23374d;
}

.button-secondary:hover {
    background: #d5dee7;
}

.button-small {
    padding: 8px 12px;
    font-size: 0.9rem;
}

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

.summary-card,
.content-card {
    background: white;
    border: 1px solid #dfe5eb;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(20, 38, 60, 0.05);
}

.summary-card {
    padding: 20px;
}

.summary-label {
    color: #66788a;
    margin-bottom: 8px;
}

.summary-number {
    font-size: 2rem;
    font-weight: 700;
}

.content-card {
    overflow: hidden;
}

.card-heading {
    padding: 18px 20px;
    border-bottom: 1px solid #e5eaf0;
}

.card-heading h2 {
    margin: 0;
    font-size: 1.2rem;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid #e5eaf0;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f8fafc;
    color: #52616f;
    font-size: 0.9rem;
}

.status-badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e7edf3;
    font-size: 0.85rem;
    text-transform: capitalize;
}

.empty-state {
    padding: 36px 20px;
    text-align: center;
    color: #66788a;
}

.alert {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
}

.alert-success {
    background: #e7f7ee;
    color: #176b3a;
}

.alert-danger {
    background: #fdebec;
    color: #9c2530;
}

.alert-warning {
    background: #fff4d6;
    color: #775600;
}

.logout-form {
    margin: 0;
}

@media (max-width: 760px) {
    .navbar,
    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav-links,
    .nav-user {
        flex-wrap: wrap;
    }

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

    .page-container {
        margin-top: 20px;
    }
}

.job-card-form {
    display: grid;
    gap: 22px;
}

.form-section {
    background: white;
    border: 1px solid #dfe5eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(20, 38, 60, 0.05);
}

.form-section-heading {
    padding: 18px 20px;
    border-bottom: 1px solid #e5eaf0;
}

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

.form-section-heading p {
    margin: 6px 0 0;
    color: #66788a;
    font-size: 0.92rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group-wide {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: #34495e;
}

.form-control {
    width: 100%;
    border: 1px solid #cbd5df;
    border-radius: 8px;
    padding: 11px 12px;
    background: white;
    color: #1f2933;
    font: inherit;
}

.form-control:focus {
    border-color: #1769aa;
    outline: 3px solid rgba(23, 105, 170, 0.14);
}

.form-control[readonly] {
    background: #edf1f5;
    color: #637282;
}

textarea.form-control {
    resize: vertical;
}

.field-error {
    margin: 0;
    color: #a52834;
    font-size: 0.88rem;
}

.checkbox-group {
    flex-direction: row;
    align-items: flex-start;
}

.checkbox-group input {
    margin-top: 4px;
}

.hours-table-wrapper {
    padding: 20px;
    overflow-x: auto;
}

.hours-table th,
.hours-table td {
    min-width: 150px;
}

.hours-table tbody th {
    background: #f8fafc;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-bottom: 32px;
}

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

    .form-group-wide {
        grid-column: auto;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .form-actions .button {
        width: 100%;
        text-align: center;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.job-card-link {
    color: #1769aa;
    font-weight: 700;
}

.job-card-link:hover {
    text-decoration: underline;
}

.detail-grid {
    display: grid;
    gap: 22px;
}

.detail-section {
    background: white;
    border: 1px solid #dfe5eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(20, 38, 60, 0.05);
}

.detail-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    padding: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-item-wide {
    grid-column: 1 / -1;
}

.detail-label {
    color: #66788a;
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.preserve-lines {
    white-space: pre-line;
}

@media (max-width: 760px) {
    .header-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .header-actions .button {
        text-align: center;
    }

    .detail-content {
        grid-template-columns: 1fr;
    }

    .detail-item-wide {
        grid-column: auto;
    }
}

.section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.section-heading-row p {
    margin: 6px 0 0;
    color: #66788a;
    font-size: 0.92rem;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-actions form {
    margin: 0;
}

.button-danger {
    background: #b8323f;
}

.button-danger:hover {
    background: #922631;
}

tfoot th {
    background: #f8fafc;
    font-weight: 700;
}

@media (max-width: 760px) {
    .section-heading-row {
        align-items: stretch;
        flex-direction: column;
    }

    .section-heading-row .button {
        text-align: center;
    }

    .table-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .table-actions .button {
        width: 100%;
        text-align: center;
    }
}

.search-panel {
    padding: 20px;
    border-bottom: 1px solid #e5eaf0;
    background: #f8fafc;
}

.search-form {
    display: grid;
    grid-template-columns:
        minmax(240px, 1fr)
        minmax(170px, 220px)
        auto;
    align-items: end;
    gap: 14px;
}

.search-field,
.status-filter {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.search-field label,
.status-filter label {
    color: #34495e;
    font-weight: 600;
}

.search-actions {
    display: flex;
    gap: 10px;
}

.results-summary {
    padding: 14px 20px;
    border-bottom: 1px solid #e5eaf0;
    color: #66788a;
    font-size: 0.92rem;
}

.empty-state h2 {
    margin-top: 0;
    color: #34495e;
}

@media (max-width: 760px) {
    .search-form {
        grid-template-columns: 1fr;
    }

    .search-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .search-actions .button {
        width: 100%;
        text-align: center;
    }
}

.search-form-expanded {
    grid-template-columns:
        minmax(230px, 1.5fr)
        minmax(150px, 0.8fr)
        minmax(150px, 0.7fr)
        minmax(150px, 0.7fr)
        auto;
}

.date-filter {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.date-filter label {
    color: #34495e;
    font-weight: 600;
}

.status-badge {
    font-weight: 700;
}

.status-draft {
    background: #e7edf3;
    color: #52616f;
}

.status-open {
    background: #e5f1ff;
    color: #145da0;
}

.status-in_progress {
    background: #fff1cc;
    color: #7a5700;
}

.status-completed {
    background: #dff5e8;
    color: #176b3a;
}

.status-cancelled {
    background: #fde5e7;
    color: #9c2530;
}

@media (max-width: 1050px) {
    .search-form-expanded {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .search-actions {
        align-self: end;
    }
}

@media (max-width: 760px) {
    .search-form-expanded {
        grid-template-columns: 1fr;
    }
}

.address-preview {
    min-height: 46px;
    padding: 11px 12px;
    border: 1px solid #d5dee7;
    border-radius: 8px;
    background: #f8fafc;
    color: #52616f;
    white-space: pre-line;
}

.distance-message {
    min-height: 20px;
    margin: 8px 0 0;
    font-size: 0.92rem;
    font-weight: 600;
}

.distance-message-success {
    color: #176b3a;
}

.distance-message-error {
    color: #a52834;
}

#calculate-distance-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.nav-user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.nav-user-details small {
    margin-top: 3px;
    color: #cbd5df;
    font-size: 0.75rem;
}

.role-badge,
.account-status,
.current-user-label {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: 700;
}

.role-badge {
    background: #e7edf3;
    color: #34495e;
}

.account-active {
    background: #dff5e8;
    color: #176b3a;
}

.account-disabled {
    background: #fde5e7;
    color: #9c2530;
}

.current-user-label {
    margin-left: 6px;
    background: #e5f1ff;
    color: #145da0;
}

.error-page {
    max-width: 650px;
    margin: 70px auto;
    padding: 48px 30px;
    border: 1px solid #dfe5eb;
    border-radius: 14px;
    background: white;
    box-shadow: 0 3px 14px rgba(20, 38, 60, 0.08);
    text-align: center;
}

.error-code {
    margin-bottom: 12px;
    color: #1769aa;
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1;
}

.error-page h1 {
    margin: 0 0 12px;
}

.error-page p {
    margin: 0 auto 26px;
    color: #66788a;
    line-height: 1.6;
}

@media (max-width: 760px) {
    .error-page {
        margin-top: 30px;
        padding: 38px 20px;
    }

    .error-code {
        font-size: 3.5rem;
    }
}

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

.export-card,
.backup-notice {
    border: 1px solid #dfe5eb;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(20, 38, 60, 0.05);
}

.export-card {
    display: flex;
    min-height: 230px;
    padding: 24px;
    justify-content: space-between;
    flex-direction: column;
    gap: 22px;
}

.export-card h2,
.backup-notice h2 {
    margin-top: 0;
}

.export-card p,
.backup-notice p {
    color: #66788a;
    line-height: 1.6;
}

.backup-notice {
    margin-top: 22px;
    padding: 22px 24px;
}

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

    .export-card {
        min-height: auto;
    }

    .export-card .button {
        text-align: center;
    }
}
.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(
        4,
        minmax(0, 1fr)
    );
    gap: 18px;
    margin-bottom: 28px;
}

.dashboard-summary-card {
    display: flex;
    min-height: 170px;
    padding: 21px;
    border: 1px solid #dfe5eb;
    border-radius: 13px;
    background: white;
    box-shadow: 0 2px 9px rgba(20, 38, 60, 0.06);
    flex-direction: column;
    justify-content: space-between;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

a.dashboard-summary-card:hover {
    border-color: #b8c8d8;
    box-shadow: 0 6px 18px rgba(20, 38, 60, 0.1);
    transform: translateY(-2px);
}

.dashboard-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-card-label {
    color: #52616f;
    font-size: 0.92rem;
    font-weight: 700;
}

.dashboard-card-icon {
    display: inline-flex;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #e5f1ff;
    color: #145da0;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
}

.dashboard-icon-open {
    background: #fff1cc;
    color: #7a5700;
}

.dashboard-icon-completed {
    background: #dff5e8;
    color: #176b3a;
    font-size: 1.1rem;
}

.dashboard-icon-users {
    background: #eee8ff;
    color: #5940a8;
}

.dashboard-card-number {
    margin: 16px 0 10px;
    color: #172b4d;
    font-size: 2.35rem;
    font-weight: 800;
    line-height: 1;
}

.dashboard-card-footer {
    color: #7a8997;
    font-size: 0.82rem;
    line-height: 1.4;
}

.card-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.card-heading-row p {
    margin: 5px 0 0;
    color: #66788a;
    font-size: 0.9rem;
}

.dashboard-table tbody tr {
    transition: background 0.12s ease;
}

.dashboard-table tbody tr:hover {
    background: #f7faff;
}

@media (max-width: 1050px) {
    .dashboard-summary-grid {
        grid-template-columns: repeat(
            2,
            minmax(0, 1fr)
        );
    }
}

@media (max-width: 760px) {
    .dashboard-summary-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-summary-card {
        min-height: 145px;
    }

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

    .card-heading-row .button {
        text-align: center;
    }
}

.advanced-filter-form {
    display: grid;
    grid-template-columns:
        repeat(6, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.filter-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
}

.filter-field-search {
    grid-column: span 2;
}

.filter-field label {
    color: #34495e;
    font-weight: 600;
}

.advanced-filter-actions {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.results-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.sortable-heading {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #52616f;
    font-weight: 700;
    white-space: nowrap;
}

.sortable-heading:hover {
    color: #1769aa;
}

.sort-indicator {
    color: #1769aa;
    font-size: 0.72rem;
}

.sort-indicator-muted {
    color: #aeb9c4;
}

.sortable-table tbody tr {
    transition: background 0.12s ease;
}

.sortable-table tbody tr:hover {
    background: #f7faff;
}

@media (max-width: 1100px) {
    .advanced-filter-form {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .filter-field-search {
        grid-column: span 2;
    }
}

@media (max-width: 760px) {
    .advanced-filter-form {
        grid-template-columns: 1fr;
    }

    .filter-field-search {
        grid-column: auto;
    }

    .advanced-filter-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .advanced-filter-actions .button {
        width: 100%;
        text-align: center;
    }

    .results-summary-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}

.activity-list {
    display: grid;
    padding: 6px 20px 20px;
}

.activity-item {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 13px;
    padding: 16px 0;
    border-bottom: 1px solid #e5eaf0;
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e7edf3;
    color: #34495e;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
}

.activity-icon-created,
.activity-icon-material_added {
    background: #dff5e8;
    color: #176b3a;
}

.activity-icon-edited,
.activity-icon-material_edited {
    background: #e5f1ff;
    color: #145da0;
}

.activity-icon-status_changed {
    background: #fff1cc;
    color: #7a5700;
}

.activity-icon-printed {
    background: #eee8ff;
    color: #5940a8;
}

.activity-icon-material_deleted {
    background: #fde5e7;
    color: #9c2530;
}

.activity-content {
    min-width: 0;
}

.activity-description {
    color: #253647;
    font-weight: 600;
    line-height: 1.45;
}

.activity-meta {
    display: flex;
    margin-top: 5px;
    color: #7a8997;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.82rem;
}

.analytics-section {
    margin-bottom: 28px;
}

.analytics-heading {
    margin-bottom: 15px;
}

.analytics-heading h2 {
    margin: 0;
    color: #253647;
    font-size: 1.3rem;
}

.analytics-heading p {
    margin: 5px 0 0;
    color: #66788a;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(
        4,
        minmax(0, 1fr)
    );
    gap: 16px;
}

.analytics-card {
    display: flex;
    min-height: 155px;
    padding: 20px;
    border: 1px solid #dfe5eb;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(20, 38, 60, 0.05);
    flex-direction: column;
    justify-content: space-between;
}

.analytics-card-wide {
    grid-column: span 2;
}

.analytics-label {
    color: #66788a;
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.035em;
}

.analytics-value {
    margin: 15px 0 12px;
    color: #172b4d;
    font-size: 2.05rem;
    font-weight: 800;
    line-height: 1;
}

.analytics-text-value {
    margin: 15px 0 12px;
    color: #172b4d;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.25;
}

.analytics-note {
    color: #7a8997;
    font-size: 0.82rem;
    line-height: 1.4;
}

.completion-progress {
    width: 100%;
    height: 8px;
    margin: 0 0 12px;
    border-radius: 999px;
    background: #e7edf3;
    overflow: hidden;
}

.completion-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: #2b8a57;
    transition: width 0.25s ease;
}

.dashboard-icon-month {
    background: #e9f3ff;
    color: #1769aa;
}

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

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

    .analytics-card-wide {
        grid-column: auto;
    }

    .analytics-card {
        min-height: 140px;
    }
}

/* ==================================================
   Professional interface refinement
   ================================================== */

:root {
    --navy-950: #122033;
    --navy-900: #182a40;
    --navy-800: #233950;

    --blue-700: #195f91;
    --blue-600: #2474aa;
    --blue-100: #eaf3f9;

    --slate-950: #17212b;
    --slate-800: #2f3d4a;
    --slate-700: #465665;
    --slate-600: #607080;
    --slate-500: #7b8996;
    --slate-300: #cbd4dc;
    --slate-200: #dde4ea;
    --slate-100: #edf1f4;
    --slate-50: #f6f8fa;

    --surface: #ffffff;

    --success-700: #26714a;
    --success-100: #e5f3eb;

    --warning-700: #80611e;
    --warning-100: #f8efd8;

    --danger-700: #9a3940;
    --danger-100: #f8e8e9;

    --radius-small: 5px;
    --radius-medium: 7px;
    --radius-large: 9px;

    --shadow-subtle:
        0 1px 2px rgba(18, 32, 51, 0.04);
}

/* General application */

body {
    background: var(--slate-50);
    color: var(--slate-950);
    font-family:
        Inter,
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;
    line-height: 1.5;
}

.page-container {
    width: min(1180px, calc(100% - 40px));
    margin: 34px auto 54px;
}

.page-header {
    margin-bottom: 22px;
}

.page-header h1 {
    color: var(--slate-950);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.page-header p {
    color: var(--slate-600);
    font-size: 0.94rem;
}

/* Navigation */

.site-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--navy-950);
}

.navbar {
    max-width: 1180px;
    min-height: 66px;
    padding: 0 20px;
}

.brand {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.nav-links {
    align-self: stretch;
    gap: 4px;
}

.nav-links a {
    display: inline-flex;
    padding: 0 12px;
    border-bottom: 3px solid transparent;
    color: #d8e0e7;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    transition:
        color 0.12s ease,
        background 0.12s ease,
        border-color 0.12s ease;
}

.nav-links a:hover {
    border-bottom-color: #83aac6;
    background: rgba(255, 255, 255, 0.04);
    color: white;
    text-decoration: none;
}

.nav-user {
    gap: 14px;
}

.nav-user-details span {
    font-size: 0.88rem;
    font-weight: 600;
}

.nav-user-details small {
    color: #9eafbe;
}

/* Buttons */

.button {
    border: 1px solid transparent;
    border-radius: var(--radius-small);
    padding: 9px 14px;
    background: var(--blue-700);
    box-shadow: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition:
        background 0.12s ease,
        border-color 0.12s ease,
        transform 0.08s ease;
}

.button:hover {
    background: #14517c;
}

.button:active {
    transform: translateY(1px);
}

.button-secondary {
    border-color: var(--slate-300);
    background: var(--surface);
    color: var(--slate-800);
}

.button-secondary:hover {
    border-color: #aebbc6;
    background: var(--slate-50);
}

.button-danger {
    background: var(--danger-700);
}

.button-danger:hover {
    background: #7f2e34;
}

.button-small {
    padding: 7px 10px;
    font-size: 0.82rem;
}

/* Cards and sections */

.content-card,
.form-section,
.detail-section,
.export-card,
.backup-notice,
.error-page {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-large);
    background: var(--surface);
    box-shadow: var(--shadow-subtle);
}

.form-section,
.detail-section {
    overflow: hidden;
}

.card-heading,
.form-section-heading {
    padding: 17px 19px;
    border-bottom: 1px solid var(--slate-200);
    background: var(--surface);
}

.card-heading h2,
.form-section-heading h2 {
    color: var(--slate-950);
    font-size: 1.05rem;
    font-weight: 700;
}

.card-heading p,
.form-section-heading p,
.section-heading-row p {
    color: var(--slate-600);
}

/* Dashboard */

.dashboard-summary-grid {
    gap: 14px;
    margin-bottom: 24px;
}

.dashboard-summary-card {
    min-height: 138px;
    padding: 19px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-large);
    background: var(--surface);
    box-shadow: var(--shadow-subtle);
    transition:
        border-color 0.12s ease,
        box-shadow 0.12s ease;
}

a.dashboard-summary-card:hover {
    border-color: #aebdca;
    box-shadow:
        0 3px 9px rgba(18, 32, 51, 0.06);
    transform: none;
}

.dashboard-card-label {
    color: var(--slate-600);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

.dashboard-card-icon {
    display: none;
}

.dashboard-card-number {
    margin: 14px 0 7px;
    color: var(--slate-950);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.035em;
}

.dashboard-card-footer {
    color: var(--slate-500);
    font-size: 0.8rem;
}

.dashboard-table tbody tr:hover,
.sortable-table tbody tr:hover {
    background: #f7f9fb;
}

/* Tables */

table {
    font-size: 0.9rem;
}

th,
td {
    padding: 12px 15px;
    border-bottom-color: var(--slate-200);
}

th {
    background: var(--slate-50);
    color: var(--slate-700);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.035em;
}

tbody tr:last-child td,
tbody tr:last-child th {
    border-bottom: 0;
}

.job-card-link {
    color: var(--blue-700);
    font-weight: 650;
}

.sortable-heading {
    color: var(--slate-700);
    font-size: inherit;
    letter-spacing: inherit;
}

.sortable-heading:hover {
    color: var(--blue-700);
}

/* Statuses */

.status-badge {
    border-radius: 4px;
    padding: 4px 7px;
    font-size: 0.74rem;
    font-weight: 650;
    letter-spacing: 0.015em;
}

.status-draft {
    background: var(--slate-100);
    color: var(--slate-700);
}

.status-open {
    background: var(--blue-100);
    color: #285f85;
}

.status-in_progress {
    background: var(--warning-100);
    color: var(--warning-700);
}

.status-completed {
    background: var(--success-100);
    color: var(--success-700);
}

.status-cancelled {
    background: var(--danger-100);
    color: var(--danger-700);
}

/* Forms */

.job-card-form {
    gap: 18px;
}

.form-grid,
.detail-content {
    gap: 17px 20px;
    padding: 19px;
}

.form-group {
    gap: 6px;
}

.form-group label,
.filter-field label,
.search-field label,
.status-filter label,
.date-filter label {
    color: var(--slate-800);
    font-size: 0.84rem;
    font-weight: 600;
}

.form-control,
.address-preview {
    border-color: var(--slate-300);
    border-radius: var(--radius-small);
    padding: 10px 11px;
}

.form-control:focus {
    border-color: var(--blue-600);
    outline: 3px solid rgba(36, 116, 170, 0.12);
}

.form-control[readonly] {
    background: var(--slate-50);
}

.form-actions {
    padding-bottom: 26px;
}

/* Search and filters */

.search-panel {
    padding: 18px;
    border-bottom-color: var(--slate-200);
    background: var(--slate-50);
}

.results-summary {
    border-bottom-color: var(--slate-200);
    color: var(--slate-600);
}

/* Reports */

.analytics-grid {
    gap: 14px;
}

.analytics-card {
    min-height: 138px;
    padding: 18px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-subtle);
}

.analytics-label {
    color: var(--slate-600);
    font-size: 0.76rem;
    letter-spacing: 0.045em;
}

.analytics-value {
    color: var(--slate-950);
    font-size: 1.85rem;
    font-weight: 700;
}

.analytics-text-value {
    color: var(--slate-950);
    font-size: 1.2rem;
    font-weight: 700;
}

.analytics-note {
    color: var(--slate-500);
}

.completion-progress {
    height: 6px;
    background: var(--slate-100);
}

.completion-progress-bar {
    background: var(--success-700);
}

/* Activity history */

.activity-item {
    grid-template-columns: 29px 1fr;
    gap: 12px;
    border-bottom-color: var(--slate-200);
}

.activity-icon {
    width: 27px;
    height: 27px;
    border-radius: 5px;
    font-size: 0.7rem;
}

.activity-description {
    color: var(--slate-800);
    font-size: 0.9rem;
    font-weight: 600;
}

.activity-meta {
    color: var(--slate-500);
}

/* Alerts */

.alert {
    border: 1px solid transparent;
    border-radius: var(--radius-medium);
    padding: 11px 14px;
    font-size: 0.9rem;
}

.alert-success {
    border-color: #b9ddc8;
    background: #edf8f1;
    color: var(--success-700);
}

.alert-danger {
    border-color: #e5c1c4;
    background: #fcf1f2;
    color: var(--danger-700);
}

.alert-warning {
    border-color: #e7d5a7;
    background: #fcf7e9;
    color: var(--warning-700);
}

/* ==================================================
   Login page
   ================================================== */

.login-page {
    display: grid;
    width: min(940px, 100%);
    min-height: 560px;
    margin: 64px auto;
    grid-template-columns: minmax(0, 0.95fr) minmax(380px, 1.05fr);
    overflow: hidden;
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    background: var(--surface);
    box-shadow:
        0 12px 32px rgba(18, 32, 51, 0.1);
}

.login-introduction {
    display: flex;
    padding: 50px 44px;
    background: var(--navy-950);
    color: white;
    flex-direction: column;
    justify-content: space-between;
}

.login-brand-mark {
    display: inline-flex;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 6px;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 750;
    letter-spacing: 0.04em;
}

.login-eyebrow {
    margin: 34px 0 9px;
    color: #a9bac8;
    font-size: 0.78rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.login-introduction h1 {
    max-width: 330px;
    margin: 0;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.login-introduction-text {
    max-width: 360px;
    margin: 20px 0 0;
    color: #c5d0da;
    font-size: 0.93rem;
    line-height: 1.7;
}

.login-system-note {
    color: #899eae;
    font-size: 0.78rem;
}

.login-panel {
    display: flex;
    padding: 54px 52px;
    align-items: center;
}

.login-panel-content {
    width: 100%;
}

.login-heading {
    margin-bottom: 29px;
}

.login-heading h2 {
    margin: 0 0 8px;
    color: var(--slate-950);
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.login-heading p {
    margin: 0;
    color: var(--slate-600);
    font-size: 0.92rem;
}

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

.login-form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.login-form-group label {
    color: var(--slate-800);
    font-size: 0.85rem;
    font-weight: 600;
}

.login-control {
    width: 100%;
    min-height: 43px;
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-small);
    padding: 10px 12px;
    background: white;
    color: var(--slate-950);
    font: inherit;
    font-size: 0.94rem;
    transition:
        border-color 0.12s ease,
        box-shadow 0.12s ease;
}

.login-control::placeholder {
    color: #9aa6b1;
}

.login-control:focus {
    border-color: var(--blue-600);
    outline: none;
    box-shadow:
        0 0 0 3px rgba(36, 116, 170, 0.12);
}

.login-field-error {
    margin: 0;
    color: var(--danger-700);
    font-size: 0.8rem;
}

.login-remember {
    display: flex;
    color: var(--slate-600);
    align-items: center;
    gap: 9px;
    font-size: 0.84rem;
    cursor: pointer;
}

.login-remember input {
    width: 15px;
    height: 15px;
    accent-color: var(--blue-700);
}

.login-submit {
    width: 100%;
    min-height: 43px;
    border: 1px solid var(--blue-700);
    border-radius: var(--radius-small);
    background: var(--blue-700);
    color: white;
    font: inherit;
    font-size: 0.91rem;
    font-weight: 650;
    cursor: pointer;
    transition: background 0.12s ease;
}

.login-submit:hover {
    background: #14517c;
}

.login-help-text {
    margin: 24px 0 0;
    color: var(--slate-500);
    font-size: 0.78rem;
    text-align: center;
}

/* Responsive refinement */

@media (max-width: 900px) {
    .navbar {
        padding-top: 13px;
        padding-bottom: 13px;
    }

    .nav-links {
        align-self: auto;
    }

    .nav-links a {
        min-height: 36px;
        padding: 0 9px;
        border: 0;
        border-radius: 4px;
    }

    .login-page {
        grid-template-columns: 1fr;
        max-width: 560px;
        margin: 35px auto;
    }

    .login-introduction {
        min-height: 270px;
        padding: 36px;
    }

    .login-eyebrow {
        margin-top: 25px;
    }

    .login-system-note {
        margin-top: 30px;
    }
}

@media (max-width: 760px) {
    .page-container {
        width: min(100% - 24px, 1180px);
        margin-top: 22px;
    }

    .navbar {
        align-items: stretch;
        gap: 14px;
    }

    .nav-links {
        gap: 3px;
    }

    .nav-user {
        width: 100%;
        justify-content: space-between;
    }

    .login-page {
        width: 100%;
        margin: 18px auto 30px;
        border-radius: 7px;
    }

    .login-introduction {
        min-height: 230px;
        padding: 29px 25px;
    }

    .login-introduction h1 {
        font-size: 1.65rem;
    }

    .login-introduction-text {
        margin-top: 14px;
        font-size: 0.88rem;
    }

    .login-panel {
        padding: 35px 25px;
    }

    .dashboard-summary-card {
        min-height: 120px;
    }
}
.pagination {
    display: flex;
    padding: 18px 20px;
    border-top: 1px solid var(--slate-200);
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-link {
    display: inline-flex;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--slate-300);
    border-radius: 5px;
    background: white;
    color: var(--slate-700);
    align-items: center;
    justify-content: center;
    font-size: 0.84rem;
    font-weight: 600;
}

a.pagination-link:hover {
    border-color: #aebbc6;
    background: var(--slate-50);
}

.pagination-link-active {
    border-color: var(--blue-700);
    background: var(--blue-700);
    color: white;
}

.pagination-link-disabled {
    color: #a9b4be;
    cursor: default;
}

.pagination-ellipsis {
    padding: 0 4px;
    color: var(--slate-500);
}

@media (max-width: 760px) {
    .pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .pagination-pages {
        justify-content: center;
        flex-wrap: wrap;
    }

    .pagination > .pagination-link {
        width: 100%;
    }
}