:root {
    --bg: #e8eef6;
    --bg-soft: #f4f8fc;
    --surface: rgba(250, 253, 255, 0.92);
    --surface-strong: #ffffff;
    --surface-tint: #edf3f9;
    --border: rgba(82, 104, 136, 0.16);
    --border-strong: rgba(82, 104, 136, 0.28);
    --text: #1f2a37;
    --muted: #6b7a8f;
    --accent: #4f86c6;
    --accent-strong: #356aa8;
    --accent-soft: #dce9f8;
    --info-soft: #d9e9fb;
    --edit-soft: #eef3f8;
    --ink-dark: #182330;
    --sidebar-top: #1f3147;
    --sidebar-bottom: #314860;
    --success: #4b8b68;
    --success-strong: #357454;
    --success-soft: #dcefe3;
    --warning: #d7a93c;
    --danger: #c05c5c;
    --danger-strong: #a34d4d;
    --danger-soft: #f4dede;
    --shadow-lg: 0 28px 80px rgba(29, 53, 87, 0.14);
    --shadow-md: 0 16px 38px rgba(29, 53, 87, 0.1);
    --shadow-sm: 0 10px 24px rgba(29, 53, 87, 0.08);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(79, 134, 198, 0.18), transparent 24%),
        radial-gradient(circle at top right, rgba(141, 169, 204, 0.18), transparent 26%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 58%, #dfe7f1 100%);
}

body.modal-open {
    overflow: hidden;
}

h1,
h2,
h3,
h4,
th {
    font-family: inherit;
    font-weight: 700;
    letter-spacing: -0.02em;
}

p,
label,
td,
span,
div,
input,
select,
textarea,
button,
a {
    line-height: 1.45;
}

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

input,
select,
textarea,
button {
    width: 100%;
    font: inherit;
}

input,
select,
textarea {
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.96);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(79, 134, 198, 0.62);
    box-shadow: 0 0 0 4px rgba(79, 134, 198, 0.14);
}

textarea {
    min-height: 128px;
    resize: vertical;
}

input[type="file"] {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.98);
}

input[type="file"]::file-selector-button {
    margin-right: 0.7rem;
    padding: 0.68rem 0.95rem;
    border: 1px solid rgba(79, 134, 198, 0.2);
    border-radius: 10px;
    background: linear-gradient(135deg, #f4f9ff 0%, #dfebf8 100%);
    color: var(--accent-strong);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input[type="file"]::file-selector-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    background: linear-gradient(135deg, #f8fbff 0%, #d7e7f8 100%);
}

button,
.actions a,
.nav-link,
.lang-pill {
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

button {
    padding: 0.72rem 1rem;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fffaf4;
    box-shadow: 0 14px 28px rgba(53, 106, 168, 0.24);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
}

button:hover,
.actions a:hover,
.nav-link:hover,
.lang-pill:hover {
    transform: translateY(-1px);
}

button:hover {
    box-shadow: 0 18px 34px rgba(53, 106, 168, 0.3);
}

.btn-save,
.btn-details,
.btn-edit,
.btn-delete,
.btn-resend {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.68rem 1rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}

.btn-save {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-strong) 100%);
    color: #f7fffa;
    box-shadow: 0 14px 28px rgba(53, 116, 84, 0.24);
}

.btn-save:hover {
    box-shadow: 0 18px 34px rgba(53, 116, 84, 0.3);
}

.btn-details,
.btn-resend {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fffaf4;
    box-shadow: 0 14px 28px rgba(53, 106, 168, 0.24);
}

.btn-details:hover,
.btn-resend:hover {
    box-shadow: 0 18px 34px rgba(53, 106, 168, 0.3);
}

.btn-edit {
    background: linear-gradient(135deg, #ffffff 0%, var(--edit-soft) 100%);
    color: var(--ink-dark);
    border: 1px solid var(--border-strong);
    box-shadow: 0 10px 20px rgba(29, 53, 87, 0.08);
}

.btn-edit:hover {
    box-shadow: 0 14px 24px rgba(29, 53, 87, 0.12);
}

.btn-delete {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-strong) 100%);
    color: #fff7f7;
    box-shadow: 0 14px 28px rgba(163, 77, 77, 0.22);
}

.btn-delete:hover {
    box-shadow: 0 18px 34px rgba(163, 77, 77, 0.3);
}

.shell {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 1.5rem;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 1.2rem;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.07), transparent 26%),
        linear-gradient(180deg, var(--sidebar-top) 0%, var(--sidebar-bottom) 100%);
    color: #eef5fc;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-top,
.nav,
.sidebar-footer {
    display: grid;
    gap: 1rem;
}

.brand-card,
.sidebar-user-card {
    padding: 1.15rem 1.1rem;
    border-radius: 24px;
    background: rgba(248, 251, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
}

.brand-card h1 {
    margin: 0.25rem 0 0.45rem;
    font-size: 1.95rem;
    font-weight: 800;
}

.brand-kicker {
    display: inline-flex;
    padding: 0.25rem 0.65rem;
    border-radius: 10px;
    background: rgba(220, 233, 248, 0.18);
    color: #d6e6fa;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.brand-card .muted,
.sidebar-user-card span {
    color: rgba(226, 237, 248, 0.78);
}

.sidebar-user-card strong,
.sidebar-user-card span {
    display: block;
}

.nav {
    align-content: start;
}

.nav-link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0.8rem 0.95rem;
    border-radius: 16px;
    color: rgba(255, 245, 235, 0.9);
    border: 1px solid transparent;
    background: transparent;
    font-weight: 600;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.is-active {
    color: #fff8f2;
    background: rgba(248, 251, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.08);
}

.nav-link.is-active {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-link-ghost {
    justify-content: center;
    background: rgba(248, 251, 255, 0.08);
}

.language-switcher {
    display: flex;
    gap: 0.6rem;
}

.lang-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    background: rgba(248, 251, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 245, 235, 0.82);
    font-weight: 700;
}

.lang-pill.is-active {
    background: rgba(220, 233, 248, 0.18);
    color: #fff7ef;
}

@media (max-width: 1500px) and (min-width: 1101px) {
    .shell {
        grid-template-columns: 205px minmax(0, 1fr);
    }

    .sidebar {
        padding: 0.95rem;
        gap: 0.75rem;
    }

    .sidebar-top,
    .nav,
    .sidebar-footer {
        gap: 0.7rem;
    }

    .brand-card,
    .sidebar-user-card {
        padding: 0.8rem 0.78rem;
        border-radius: 18px;
    }

    .brand-card h1 {
        margin: 0.15rem 0 0.22rem;
        font-size: 1.35rem;
    }

    .brand-kicker {
        padding: 0.18rem 0.48rem;
        font-size: 0.68rem;
    }

    .sidebar-user-card strong {
        font-size: 0.88rem;
    }

    .sidebar-user-card span {
        font-size: 0.76rem;
    }

    .nav-link {
        min-height: 38px;
        padding: 0.58rem 0.7rem;
        border-radius: 12px;
        font-size: 0.82rem;
    }

    .lang-pill {
        min-width: 42px;
        padding: 0.46rem 0.6rem;
        font-size: 0.76rem;
    }
}

.content {
    padding: 1.25rem;
}

.content-inner {
    display: grid;
    gap: 1.5rem;
    max-width: none;
}

.page-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.2rem 0.2rem 0;
    margin-bottom: 0.15rem;
}

.page-header h2,
.page-header h3 {
    margin: 0;
    font-size: 1.45rem;
}

.page-header p {
    margin: 0.35rem 0 0;
}

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

.card,
.form-card,
.table-card,
.flash {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 248, 252, 0.95) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.35rem;
    box-shadow: var(--shadow-md);
}

.card::before,
.form-card::before,
.table-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(79, 134, 198, 0.82), rgba(129, 159, 196, 0.6), rgba(113, 146, 181, 0.45));
    opacity: 0.9;
}

.card h3,
.form-card h3,
.table-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.08rem;
}

.card p {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-strong);
}

.flash {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 1.15rem;
    border-left: 6px solid var(--success);
}

.flash-success {
    border-left-color: var(--success);
}

.flash-error {
    border-left-color: var(--danger);
    background: linear-gradient(180deg, rgba(255, 250, 250, 0.98) 0%, rgba(244, 222, 222, 0.92) 100%);
}

.flash-warning {
    border-left-color: var(--warning);
    background: linear-gradient(180deg, rgba(255, 252, 246, 0.98) 0%, rgba(250, 239, 214, 0.94) 100%);
}

.form-feedback {
    margin-bottom: 1rem;
}

.muted {
    color: var(--muted);
}

form {
    display: grid;
    gap: 1rem;
}

label {
    display: grid;
    gap: 0.45rem;
    font-weight: 600;
    color: var(--ink-dark);
}

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

.autocomplete {
    position: relative;
}

.autocomplete-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    z-index: 20;
    display: none;
    gap: 0.3rem;
    padding: 0.45rem;
    background: var(--surface-strong);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
}

.autocomplete-menu.is-open {
    display: grid;
}

.autocomplete-item {
    text-align: left;
    padding: 0.8rem 0.85rem;
    background: #fff;
    color: var(--text);
    border: 1px solid transparent;
    border-radius: 12px;
    width: 100%;
    box-shadow: none;
}

.autocomplete-item:hover {
    background: var(--surface-tint);
    border-color: rgba(79, 134, 198, 0.2);
}

.owner-picker {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid var(--border);
}

.owner-search {
    max-width: 420px;
}

.owner-list {
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 0.45rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    display: grid;
    gap: 0.45rem;
}

.owner-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.owner-item:hover {
    background: var(--surface-tint);
    border-color: rgba(79, 134, 198, 0.18);
}

.owner-item input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--accent);
}

.repair-picker {
    display: grid;
    gap: 1rem;
    margin-bottom: 0.2rem;
    padding: 1.2rem;
    border: 1px solid var(--border);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(238, 245, 252, 0.72));
}

.repair-picker-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.repair-mode-option {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    width: auto;
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--border);
}

.repair-mode-option input {
    width: auto;
    margin: 0;
    accent-color: var(--accent);
}

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

.repair-picker-results,
.repair-picker-details {
    display: grid;
    gap: 0.65rem;
}

.repair-picker-results h4,
.repair-picker-details h4 {
    margin: 0;
}

.repair-choice-list {
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    display: grid;
    gap: 0.5rem;
    padding: 0.45rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
}

.repair-choice-item,
.repair-choice-static {
    width: 100%;
    text-align: left;
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
}

.repair-choice-item {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
}

.repair-choice-item:hover {
    background: var(--surface-tint);
    border-color: rgba(79, 134, 198, 0.22);
}

.repair-choice-item.is-active {
    background: linear-gradient(180deg, rgba(220, 233, 248, 0.95), rgba(203, 224, 246, 0.98));
    border-color: rgba(79, 134, 198, 0.5);
    color: var(--accent-strong);
    box-shadow: 0 12px 24px rgba(53, 106, 168, 0.14);
}

.repair-choice-static {
    background: var(--surface-tint);
    border: 1px solid var(--border);
}

.repair-selected-summary {
    min-height: 1.8rem;
    padding: 0.1rem 0.2rem;
    color: var(--muted);
}

.repair-cost-editor {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
}

.repair-cost-editor-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.repair-total-field {
    width: min(240px, 100%);
    margin: 0;
}

.repair-total-field input[readonly] {
    background: rgba(241, 246, 252, 0.95);
    color: var(--ink-dark);
}

.repair-cost-table-wrap,
.detail-cost-table-wrap {
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
}

.repair-cost-table,
.detail-cost-table {
    width: 100%;
    min-width: 520px;
}

.repair-cost-table thead th,
.detail-cost-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.repair-cost-table td,
.detail-cost-table td {
    padding: 0.55rem;
    border-top: 1px solid rgba(209, 220, 233, 0.6);
    vertical-align: middle;
}

.repair-cost-table td input {
    margin: 0;
}

.repair-cost-table-actions {
    display: flex;
    justify-content: flex-end;
}

.repair-cost-add-row {
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 999px;
    font-size: 1.35rem;
    line-height: 1;
}

.calendar-filters {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.8rem;
}

.calendar-weekday {
    padding: 0.9rem;
    border-radius: 16px;
    background: var(--surface-tint);
    border: 1px solid var(--border);
    font-weight: 700;
    text-align: center;
    color: var(--ink-dark);
}

.calendar-day {
    height: 200px;
    min-height: 200px;
    max-height: 200px;
    padding: 0.9rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.78);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0.75rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
    overflow: hidden;
}

.calendar-day-outside {
    opacity: 0.48;
}

.calendar-day-number {
    font-weight: 700;
    font-size: 1.05rem;
}

.calendar-day-events {
    display: grid;
    gap: 0.5rem;
    align-content: start;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.2rem;
}

.calendar-event {
    display: grid;
    gap: 0.25rem;
    padding: 0.65rem 0.7rem;
    border-radius: 14px;
    font-size: 0.92rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}

.calendar-event-link {
    color: inherit;
    text-decoration: none;
}

.calendar-event-link:hover {
    filter: brightness(0.98);
}

.calendar-status-ongoing {
    background: #f5d67b;
    color: #4c3b08;
}

.calendar-status-cancelled {
    background: #d97a7a;
    color: #fff8f8;
}

.calendar-status-finished {
    background: #86bb93;
    color: #16311d;
}

.calendar-event-reminder {
    background: linear-gradient(135deg, #eadbff 0%, #cfb6ff 100%);
    color: #44206f;
    border-color: rgba(104, 63, 168, 0.24);
    box-shadow: 0 8px 18px rgba(104, 63, 168, 0.16);
}

.calendar-empty {
    color: var(--muted);
    font-size: 0.92rem;
}

.table-card {
    overflow: hidden;
    padding: 1rem 1rem 0.7rem;
}

.repairs-table-card {
    overflow: hidden;
    --repair-table-head-offset: 48px;
}

.table-scroll-top {
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0 0 0.55rem;
    padding: 0 0 0.15rem;
}

.table-scroll-top::-webkit-scrollbar,
.repairs-table-scroll::-webkit-scrollbar {
    height: 12px;
    width: 12px;
}

.table-scroll-top::-webkit-scrollbar-thumb,
.repairs-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(79, 134, 198, 0.34);
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.72);
}

.table-scroll-spacer {
    height: 1px;
}

.repairs-table-scroll {
    overflow: auto;
    max-height: 62vh;
    border: 1px solid rgba(190, 206, 223, 0.72);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.52);
}

.audit-table-card {
    padding-bottom: 1rem;
}

.audit-table-scroll {
    max-height: 68vh;
    overflow: auto;
    border-radius: 18px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.8rem 0.75rem;
    background: linear-gradient(180deg, #f1f6fc 0%, #e6eef7 100%);
    color: var(--ink-dark);
    border-bottom: 1px solid var(--border-strong);
    text-align: left;
    font-size: 0.8rem;
}

thead th:first-child {
    border-top-left-radius: 18px;
}

thead th:last-child {
    border-top-right-radius: 18px;
}

.table-filter-row th {
    position: static;
    padding: 0.45rem 0.55rem 0.6rem;
    background: rgba(241, 246, 252, 0.82);
    vertical-align: top;
}

.table-filter-row input,
.table-filter-row select {
    height: 30px;
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
}

.table-filter-actions {
    min-width: 132px;
}

.repairs-table-scroll thead th {
    z-index: 2;
}

.repairs-table-scroll .table-filter-row th {
    position: sticky;
    top: var(--repair-table-head-offset);
    z-index: 2;
}

.repairs-table-scroll thead th:first-child {
    border-top-left-radius: 18px;
}

.repairs-table-scroll thead th:last-child {
    border-top-right-radius: 18px;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.table-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.table-preset-button,
.sort-button {
    width: auto;
    min-width: 0;
    height: 30px;
    padding: 0.35rem 0.55rem;
    border-radius: 10px;
    font-size: 0.76rem;
}

.table-preset-button {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: none;
}

.table-preset-button.is-active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fffaf4;
}

.sort-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    background: transparent;
    color: inherit;
    box-shadow: none;
    border: 0;
    font-weight: 700;
    text-align: left;
}

.sort-button::after {
    content: "↕";
    font-size: 0.72rem;
    color: var(--muted);
}

.sort-button.is-asc::after {
    content: "↑";
    color: var(--accent-strong);
}

.sort-button.is-desc::after {
    content: "↓";
    color: var(--accent-strong);
}

.table-filter-actions button,
.table-filter-actions a {
    width: 100%;
    min-width: 0;
    height: 30px;
    padding: 0.35rem 0.55rem;
    font-size: 0.76rem;
}

.table-filter-actions button[data-reset-repair-filters] {
    margin-top: 0.35rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: none;
}

.table-filter-actions button[data-reset-repair-filters] {
    margin-top: 0.35rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: none;
}

tbody td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid rgba(82, 104, 136, 0.12);
    background: rgba(255, 255, 255, 0.52);
    vertical-align: top;
    text-align: left;
    font-size: 0.82rem;
    line-height: 1.35;
}

tbody tr:hover td {
    background: rgba(242, 247, 252, 0.9);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.58rem;
    border-radius: 10px;
    background: var(--surface-tint);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-status-ongoing {
    background: #f5d67b;
    border-color: rgba(201, 151, 32, 0.28);
    color: #4c3b08;
}

.badge-status-offer {
    background: #d6c3f7;
    border-color: rgba(108, 76, 163, 0.24);
    color: #43206d;
}

.badge-status-cancelled {
    background: #d97a7a;
    border-color: rgba(160, 67, 67, 0.22);
    color: #fff8f8;
}

.badge-status-finished {
    background: #86bb93;
    border-color: rgba(58, 123, 78, 0.22);
    color: #16311d;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: flex-start;
    justify-content: flex-start;
}

.actions-compact {
    flex-wrap: nowrap;
    gap: 0.35rem;
}

td.actions {
    display: table-cell;
    white-space: nowrap;
    vertical-align: top;
}

td.actions > * {
    margin-right: 0.4rem;
    vertical-align: top;
}

td.actions.actions-compact > * {
    margin-right: 0.35rem;
}

td.actions > *:last-child {
    margin-right: 0;
}

.actions button,
.actions a {
    width: auto;
}

.actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    height: 30px;
    padding: 0.35rem 0.55rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 700;
    font-size: 0.76rem;
    white-space: nowrap;
}

.actions form {
    margin: 0;
}

td.actions form {
    display: inline-block;
}

.actions button {
    min-width: 72px;
    height: 30px;
    padding: 0.35rem 0.55rem;
    border-radius: 12px;
    font-size: 0.76rem;
    box-shadow: 0 10px 20px rgba(53, 106, 168, 0.18);
    white-space: nowrap;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem !important;
    min-width: 2.2rem !important;
    height: 2.2rem !important;
    padding: 0 !important;
    border-radius: 12px;
}

.icon-button svg {
    width: 1.05rem;
    height: 1.05rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.inline-status-form {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    margin: 0;
}

.inline-status-select {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
    height: 30px;
    padding: 0.25rem 0.45rem;
    border-radius: 10px;
    font-size: 0.76rem;
    font-weight: 700;
    box-shadow: none;
    background: var(--surface-tint);
    color: var(--text);
}

.inline-status-select option {
    color: var(--text);
    background: #ffffff;
}

.table-clip {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-clip-medium {
    max-width: 120px;
}

.table-clip-wide {
    max-width: 180px;
}

.table-clip-title {
    max-width: 220px;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.repairs-table-card table th:nth-child(2),
.repairs-table-card table td:nth-child(2) {
    min-width: 180px;
    width: 180px;
}

.repairs-table-card .table-clip-title {
    max-width: 180px;
}

.table-clip-date {
    max-width: 92px;
}

.repairs-table-card table th:nth-child(8),
.repairs-table-card table td:nth-child(8) {
    min-width: 88px;
    width: 88px;
}

.repairs-table-card table th:nth-child(9),
.repairs-table-card table td:nth-child(9) {
    min-width: 112px;
    width: 112px;
}

.repairs-table-card table td:nth-child(8) .table-clip-date {
    max-width: 88px;
}

.repairs-table-card table td:nth-child(9) .table-clip-date {
    max-width: 112px;
}

.table-clip-id {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 132px;
    font-weight: 700;
    vertical-align: middle;
}

.attachment-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 20px;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid rgba(79, 134, 198, 0.26);
    color: var(--accent-strong);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.inline {
    display: inline;
}

.login-wrap {
    max-width: 620px;
    margin: 6vh auto;
}

.login-wrap .form-card {
    padding: 1.6rem;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 1.4rem;
    background: rgba(20, 33, 48, 0.52);
    backdrop-filter: blur(8px);
}

.modal-card {
    width: min(940px, 100%);
    max-height: min(88vh, 920px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(242, 247, 252, 0.98));
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: var(--shadow-lg);
}

.repair-editor-backdrop {
    z-index: 120;
}

.repair-editor-modal {
    width: min(1180px, 100%);
    max-height: min(92vh, 1100px);
}

.repair-editor-modal .modal-body,
.car-editor-modal .modal-body {
    display: block;
}

.repair-editor-card {
    padding: 1.1rem;
    box-shadow: none;
}

.repair-editor-card::before {
    display: none;
}

.car-editor-backdrop {
    z-index: 120;
}

.car-editor-modal {
    width: min(980px, 100%);
    max-height: min(92vh, 1000px);
}

.car-editor-card {
    padding: 1.1rem;
    box-shadow: none;
}

.car-editor-card::before {
    display: none;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 250, 254, 0.98));
}

.modal-header h3 {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.modal-close {
    flex: 0 0 auto;
    color: #a64646;
    background: linear-gradient(135deg, #fff7f7 0%, #f6dddd 100%);
    border: 1px solid rgba(166, 70, 70, 0.24);
    box-shadow: 0 10px 20px rgba(166, 70, 70, 0.12);
}

.modal-close:hover {
    box-shadow: 0 14px 24px rgba(166, 70, 70, 0.18);
}

.modal-body {
    padding: 1.25rem;
    display: grid;
    gap: 1rem;
    overflow-x: hidden;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem 1.15rem;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(246, 250, 254, 0.96), rgba(240, 246, 252, 0.99));
    flex: 0 0 auto;
}

.modal-editor-footer button {
    width: auto;
    min-width: 120px;
}

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

.detail-item,
.detail-block {
    display: grid;
    gap: 0.35rem;
    padding: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.7);
}

.detail-label {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.detail-text {
    line-height: 1.6;
    word-break: break-word;
}

.detail-link-list {
    display: grid;
    gap: 0.35rem;
}

.detail-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1.5fr);
    gap: 0.75rem;
    align-items: center;
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(209, 220, 233, 0.38);
    border-radius: 14px;
    color: inherit;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.78);
    transition: background 0.16s ease, border-color 0.16s ease;
}

.detail-link-row:hover,
.detail-link-row:focus-visible {
    background: rgba(220, 233, 248, 0.92);
    border-color: rgba(79, 134, 198, 0.34);
}

.detail-link-row span {
    min-width: 0;
    word-break: break-word;
}

.table-card tbody tr.is-focused {
    background: linear-gradient(180deg, rgba(232, 240, 249, 0.98), rgba(220, 233, 248, 0.98));
    box-shadow: inset 0 0 0 1px rgba(79, 134, 198, 0.22);
}

.repair-image-sections {
    display: grid;
    gap: 1rem;
}

.repair-image-section {
    display: grid;
    gap: 0.65rem;
}

.repair-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 180px));
    gap: 0.85rem;
}

.repair-image-link {
    display: block;
    width: 180px;
    height: 140px;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.82);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.repair-image-link:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.repair-image-thumb {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.repair-image-manage {
    display: grid;
    gap: 0.45rem;
    width: 180px;
}

.repair-image-manage form {
    margin: 0;
}

.repair-image-manage button {
    width: 100%;
    min-width: 0;
}

.car-attachment-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 180px));
}

.car-attachment-card {
    display: grid;
    gap: 0.45rem;
    width: 180px;
}

.car-attachment-link {
    display: block;
    width: 180px;
    min-height: 140px;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.82);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.car-attachment-link:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.car-attachment-file {
    display: grid;
    place-items: center;
    width: 100%;
    height: 140px;
    padding: 1rem;
    background: linear-gradient(180deg, rgba(220, 233, 248, 0.95), rgba(237, 243, 249, 0.95));
    color: var(--accent-strong);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-align: center;
}

.car-attachment-name {
    font-size: 0.8rem;
    word-break: break-word;
    overflow-wrap: anywhere;
}

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

    .sidebar {
        position: relative;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .content {
        padding-top: 1.1rem;
    }
}

@media (max-width: 1024px) {
    .repairs-table-scroll {
        max-height: 58vh;
    }
}

@media (max-width: 900px) {
    .content {
        padding: 1rem;
    }

    .content-inner {
        gap: 1rem;
    }

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

    .page-header {
        align-items: start;
        flex-direction: column;
    }

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

    .modal-header {
        align-items: center;
        flex-direction: row;
    }

    .modal-close {
        width: 2.2rem;
    }

    .modal-editor-footer button {
        width: auto;
    }
}

@media (max-width: 640px) {
    .sidebar,
    .content {
        padding: 0.9rem;
    }

    .brand-card h1 {
        font-size: 1.65rem;
    }

    .card,
    .form-card,
    .table-card,
    .flash {
        padding: 1rem;
        border-radius: 22px;
    }

    .form-grid,
    .repair-picker-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

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

    thead {
        display: none;
    }

    table,
    tbody,
    tr,
    td {
        display: block;
        width: 100%;
    }

    tbody tr {
        margin-bottom: 0.85rem;
        border: 1px solid var(--border);
        border-radius: 18px;
        overflow: hidden;
        box-shadow: var(--shadow-sm);
    }

    tbody td {
        border-bottom: 1px solid rgba(82, 104, 136, 0.08);
    }

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