:root {
    --mw-blue: #0d6efd;
    --mw-blue-dark: #0a2f66;
    --mw-black: #111827;
    --mw-soft: #f4f8ff;
    --mw-border: #d9e4f2;
}

* {
    letter-spacing: 0;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--mw-black);
    background: linear-gradient(180deg, #ffffff 0%, #edf5ff 100%);
    font-family: "Segoe UI", Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

#main-content {
    scroll-margin-top: 18px;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    width: 286px;
    height: 100vh;
    padding: 22px;
    overflow: hidden;
    color: #fff;
    background: #07172f;
    border-right: 1px solid rgba(255, 255, 255, .08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 0 22px;
    color: #fff;
    text-decoration: none;
}

.brand-logo-wrap {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 72px;
    height: 52px;
    padding: 5px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 8px;
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: #a9bdd6;
    font-size: .78rem;
}

.sidebar > .nav {
    display: flex;
    flex-flow: column nowrap;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(169, 189, 214, .45) transparent;
}

.sidebar .nav-link {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    white-space: nowrap;
    color: #bfd0e5;
    border-radius: 8px;
}

.sidebar .nav-link span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: rgba(13, 110, 253, .22);
}

.nav-submenu {
    display: grid;
    gap: 2px;
    margin: -2px 0 4px 18px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, .12);
}

.sidebar .nav-sublink {
    min-height: 34px;
    padding: 6px 10px;
    font-size: .9rem;
}

.sidebar .nav-sublink i {
    font-size: .9rem;
}

.sidebar .nav-sublink.active {
    background: rgba(13, 110, 253, .32);
}

.sidebar-card {
    flex: 0 0 auto;
    margin-top: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
}

.sidebar-card small,
.sidebar-card span {
    display: block;
    color: #a9bdd6;
}

.main-panel {
    flex: 1;
    min-width: 0;
    padding: 28px;
}

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

.topbar h1 {
    margin: 0;
    font-size: clamp(1.6rem, 2vw, 2.35rem);
    font-weight: 800;
    color: var(--mw-blue-dark);
}

.topbar p {
    margin: 4px 0 0;
    color: #5d6b7b;
}

.eyebrow {
    margin: 0 0 6px !important;
    font-size: .76rem;
    font-weight: 800;
    color: var(--mw-blue) !important;
    text-transform: uppercase;
}

.topbar-actions,
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-card,
.stat-card,
.login-card {
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--mw-border);
    border-radius: 8px;
    box-shadow: 0 20px 48px rgba(11, 47, 102, .08);
}

.content-card {
    padding: 18px;
    margin-bottom: 18px;
}

.ticket-issue {
    min-width: 260px;
    max-width: 520px;
    white-space: normal;
}

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
}

.stat-card small {
    display: block;
    color: #6b7280;
}

.stat-card strong {
    display: block;
    font-size: 1.55rem;
    line-height: 1.15;
}

.toolbar {
    justify-content: flex-end;
    margin-bottom: 16px;
}

.search-box {
    max-width: 330px;
}

.machine-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.machine-filter .form-select {
    flex: 1 1 auto;
    min-width: 220px;
}

.machine-filter .btn {
    flex: 0 0 auto;
}

.table {
    margin-bottom: 0;
}

.table th {
    color: #304053;
    font-size: .8rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.machine-thumb {
    width: 58px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
}

.vehicle-thumb {
    flex: 0 0 auto;
    width: 58px;
    height: 42px;
    object-fit: cover;
    background: #e9f0f8;
    border: 1px solid var(--mw-border);
    border-radius: 6px;
}

.machine-photo-cell {
    position: relative;
    width: 72px;
}

.machine-photo-button {
    display: inline-grid;
    place-items: center;
    padding: 0;
    background: transparent;
    border: 0;
}

.machine-photo-button:focus-visible {
    outline: 3px solid rgba(13, 110, 253, .35);
    outline-offset: 3px;
    border-radius: 8px;
}

.photo-count-badge {
    position: absolute;
    right: 6px;
    bottom: 7px;
    min-width: 20px;
    padding: 1px 6px;
    color: #fff;
    background: #0a2f66;
    border: 2px solid #fff;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}

.modal-subtitle {
    margin: 3px 0 0;
    color: #64748b;
    font-size: .9rem;
}

.machine-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.machine-gallery-item {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #e9f0f8;
    border: 1px solid var(--mw-border);
    border-radius: 8px;
}

.machine-gallery-link {
    display: block;
    width: 100%;
    height: 100%;
}

.machine-gallery-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .18s ease;
}

.machine-gallery-item:hover .machine-gallery-link img {
    transform: scale(1.03);
}

.gallery-primary-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    color: #fff;
    background: rgba(10, 47, 102, .9);
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
}

.gallery-delete-form {
    position: absolute;
    right: 10px;
    top: 10px;
}

.gallery-delete-form .btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .22);
}

.empty-gallery {
    display: grid;
    place-items: center;
    min-height: 220px;
    color: #64748b;
    text-align: center;
    background: #f8fbff;
    border: 1px dashed #9db7d8;
    border-radius: 8px;
}

.empty-gallery i {
    font-size: 2rem;
}

.empty-gallery p {
    margin: 6px 0 0;
}

.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 6px;
    border-radius: 999px;
}

.form-section {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.span-2 {
    grid-column: span 2;
}

.span-3 {
    grid-column: span 3;
}

.repair-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.repair-info-field {
    min-height: 68px;
    padding: 12px;
    background: #f8fbff;
    border: 1px solid var(--mw-border);
    border-radius: 8px;
}

.repair-info-field small,
.repair-info-field strong {
    display: block;
}

.repair-info-field small {
    margin-bottom: 5px;
    color: #64748b;
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
}

.repair-info-field strong {
    color: #172033;
    font-weight: 700;
    white-space: pre-wrap;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Keep every form modal within the viewport while its body scrolls. */
.modal-dialog .modal-content > form {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    min-height: 0;
}

.modal-dialog .modal-content > form > .modal-header,
.modal-dialog .modal-content > form > .modal-footer {
    flex-shrink: 0;
}

.modal-dialog .modal-content > form > .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.repair-request-dialog {
    max-width: min(1100px, calc(100% - 24px));
    min-height: calc(100% - 48px);
    margin-top: 24px;
    margin-bottom: 24px;
}

.repair-request-dialog .modal-content {
    height: calc(100vh - 48px);
    height: calc(100dvh - 48px);
    max-height: calc(100vh - 48px);
    overflow: hidden;
}

.repair-request-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    min-height: 0;
}

.repair-request-form .modal-header,
.repair-request-form .modal-footer {
    flex-shrink: 0;
}

.repair-request-form .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.machine-modal-dialog {
    max-width: min(800px, calc(100% - 24px));
    min-height: calc(100% - 48px);
    margin-top: 24px;
    margin-bottom: 24px;
}

.machine-modal-dialog .modal-content {
    height: calc(100vh - 48px);
    height: calc(100dvh - 48px);
    max-height: calc(100vh - 48px);
    overflow: hidden;
}

.machine-modal-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    min-height: 0;
}

.machine-modal-form .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.modal-form-stack {
    display: grid;
    gap: 0;
}

.modal-form-section {
    padding: 18px 0;
    border-top: 1px solid var(--mw-border);
}

.modal-form-section:first-child {
    padding-top: 0;
    border-top: 0;
}

.modal-form-section:last-child {
    padding-bottom: 0;
}

.modal-form-section h3 {
    margin: 0 0 12px;
    color: var(--mw-blue-dark);
    font-size: .9rem;
    font-weight: 800;
    text-transform: uppercase;
}

.vehicle-modal-dialog {
    max-width: min(920px, calc(100% - 24px));
}

.vehicle-form-section {
    padding: 20px;
    margin-bottom: 14px;
    background: #f8fbff;
    border: 1px solid var(--mw-border);
    border-radius: 8px;
}

.vehicle-form-section:first-child {
    padding-top: 20px;
    border-top: 1px solid var(--mw-border);
}

.vehicle-form-section:last-child {
    padding-bottom: 20px;
    margin-bottom: 0;
}

.vehicle-form-section h3 {
    display: flex;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #dfe8f3;
}

.renewal-stack {
    display: grid;
    gap: 20px;
}

.renewal-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.renewal-list-heading h2 {
    color: var(--mw-blue-dark);
    font-weight: 800;
}

.renewal-card {
    padding: 20px;
    background: #f8fbff;
    border: 1px solid var(--mw-border);
    border-radius: 8px;
}

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

.renewal-card-header h3,
.renewal-form h4 {
    margin: 0;
    color: var(--mw-blue-dark);
    font-size: .95rem;
    font-weight: 800;
}

.renewal-card-header small {
    color: #64748b;
}

.renewal-table {
    min-width: 760px;
    background: #fff;
    border: 1px solid var(--mw-border);
}

.renewal-table td {
    vertical-align: middle;
}

.renewal-form {
    padding-top: 18px;
    border-top: 1px solid var(--mw-border);
}

.renewal-form h4 {
    margin-bottom: 14px;
}

.workflow-table {
    margin-bottom: 0;
}

.workflow-table th {
    color: #64748b;
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.workflow-table td:first-child {
    color: var(--mw-blue-dark);
    font-weight: 700;
}

.materials-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.materials-table-wrap {
    border: 1px solid var(--mw-border);
    border-radius: 8px;
}

.materials-table th,
.materials-table td {
    padding: 8px;
}

.materials-table th:nth-child(1) {
    width: 42%;
}

.materials-table th:nth-child(2),
.materials-table th:nth-child(3) {
    width: 18%;
}

.materials-table th:nth-child(5) {
    width: 44px;
}

.materials-table tfoot th {
    background: #f8fbff;
}

.btn-group form {
    display: inline-flex;
}

.btn-group form .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.thumb-placeholder {
    display: grid;
    place-items: center;
    width: 58px;
    height: 42px;
    color: #64748b;
    background: #e9f0f8;
    border: 1px solid var(--mw-border);
    border-radius: 6px;
}

.photo-dropzone {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 112px;
    padding: 14px;
    cursor: pointer;
    background: #f8fbff;
    border: 1px dashed #9db7d8;
    border-radius: 8px;
    transition: border-color .15s ease, background-color .15s ease;
}

#photoUploadModal {
    z-index: 1070;
}

.modal-backdrop.photo-upload-backdrop {
    z-index: 1060;
    opacity: .72;
}

.photo-dropzone:hover,
.photo-dropzone.is-dragging {
    background: #eef6ff;
    border-color: var(--mw-blue);
}

.photo-dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.photo-dropzone strong,
.photo-dropzone small {
    display: block;
}

.photo-dropzone small {
    margin-top: 3px;
    color: #64748b;
}

.photo-preview {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 96px;
    height: 72px;
    color: #64748b;
    background: #e9f0f8;
    border: 1px solid var(--mw-border);
    border-radius: 6px;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

.photo-preview.is-empty i {
    font-size: 1.7rem;
}

.photo-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.repair-photo-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.repair-photo-preview {
    position: relative;
    width: 120px;
    height: 90px;
    overflow: hidden;
    background: #e9f0f8;
    border: 1px solid var(--mw-border);
    border-radius: 8px;
}

.repair-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.repair-photo-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
}

.photo-chip {
    position: relative;
    display: block;
    width: 74px;
    height: 54px;
    background: #e9f0f8;
    border: 1px solid var(--mw-border);
    border-radius: 6px;
    overflow: hidden;
}
.photo-chip-removable { width: 100px; height: 74px; }
.photo-chip-remove { position:absolute; top:3px; right:3px; z-index:2; display:grid; place-items:center; width:26px; height:26px; padding:0; cursor:pointer; border:2px solid #fff; border-radius:50%; color:#fff; background:#dc3545; font-size:.7rem; line-height:1; box-shadow:0 3px 9px rgba(15,23,42,.3); }
.photo-chip-remove:hover { background:#b02a37; }
.photo-upload-trigger { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; padding:12px 14px; color:#334155; background:#f8fbff; border:1px dashed #9db7d8; border-radius:8px; }

.photo-chip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mock-note {
    padding: 12px 14px;
    color: #084298;
    background: #dbeafe;
    border: 1px solid #b6d4fe;
    border-radius: 8px;
}

.service-machine-summary {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.service-machine-summary > div {
    min-width: 0;
    padding: 12px;
    background: #f8fbff;
    border: 1px solid var(--mw-border);
    border-radius: 8px;
}

.service-machine-summary small,
.service-machine-summary span {
    display: block;
    color: #64748b;
}

.service-machine-summary strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 1rem;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(rgba(7, 23, 47, .68), rgba(7, 23, 47, .82)),
        url("https://images.unsplash.com/photo-1581092160607-ee22731c9c5c?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.login-card {
    width: min(100%, 440px);
    padding: 30px;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.login-logo-wrap {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 116px;
    height: 82px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--mw-border);
    border-radius: 8px;
}

.login-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-logo h1 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--mw-blue-dark);
}

.login-logo p {
    margin: 0;
    color: #667085;
}

.speed-login-panel {
    padding-top: 14px;
    border-top: 1px solid var(--mw-border);
}

.speed-login-title {
    margin-bottom: 10px;
    font-size: .86rem;
    font-weight: 800;
    color: var(--mw-blue-dark);
    text-transform: uppercase;
}

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

.speed-login-grid form:first-child {
    grid-column: span 2;
}

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

.notification-center { position: relative; }
.notification-bell { position: relative; }
.notification-badge { position:absolute; top:-7px; right:-7px; min-width:20px; height:20px; padding:0 5px; border:2px solid #fff; border-radius:999px; color:#fff; background:#dc3545; font-size:.68rem; font-weight:800; line-height:16px; text-align:center; }
.notification-menu { width:min(390px, calc(100vw - 24px)); padding:0; overflow:hidden; border:1px solid var(--mw-border); box-shadow:0 18px 50px rgba(15, 23, 42, .18); }
.notification-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:15px 16px; border-bottom:1px solid var(--mw-border); }
.notification-header strong, .notification-header small { display:block; }
.notification-header small { color:#64748b; font-size:.75rem; }
.notification-header .btn-link { padding:0; text-decoration:none; white-space:nowrap; }
.notification-list { max-height:390px; overflow-y:auto; }
.notification-list form { margin:0; }
.notification-item { display:grid; grid-template-columns:38px 1fr; gap:11px; width:100%; padding:13px 16px; color:#26354a; background:#fff; border:0; border-bottom:1px solid #edf1f6; text-align:left; }
.notification-item:hover { background:#f5f9ff; }
.notification-item.is-unread { background:#eef6ff; }
.notification-item.is-unread::after { position:absolute; right:10px; width:7px; height:7px; margin-top:5px; border-radius:50%; background:var(--mw-blue, #0d6efd); content:''; }
.notification-item > span:last-child { min-width:0; padding-right:8px; }
.notification-item strong, .notification-item span span, .notification-item small { display:block; }
.notification-item strong { margin-bottom:2px; color:var(--mw-blue-dark); font-size:.86rem; }
.notification-item span span { overflow:hidden; color:#526176; font-size:.8rem; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
.notification-item small { margin-top:4px; color:#8793a5; font-size:.7rem; }
.notification-icon { display:grid; place-items:center; width:36px; height:36px; border-radius:50%; color:var(--mw-blue, #0d6efd); background:#dcecff; }
.notification-settings { display:flex; align-items:center; justify-content:center; gap:7px; padding:12px; color:var(--mw-blue, #0d6efd); background:#f8fafc; font-size:.8rem; font-weight:700; text-decoration:none; }
.notification-empty { display:grid; justify-items:center; gap:8px; padding:38px 16px; color:#7a8798; font-size:.85rem; }
.notification-empty i { font-size:1.6rem; }

.lane-title {
    margin-bottom: 12px;
    font-size: .9rem;
    font-weight: 800;
    color: var(--mw-blue-dark);
    text-transform: uppercase;
}

.development-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    max-width: 720px;
}

.development-photo-grid img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border: 1px solid #dfe4ee;
    border-radius: 8px;
}

.development-timeline {
    border-left: 2px solid #dfe4ee;
    margin-left: 8px;
    padding-left: 20px;
}

.development-update {
    position: relative;
    padding: 0 0 18px;
}

.development-update::before {
    position: absolute;
    top: 5px;
    left: -27px;
    width: 12px;
    height: 12px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--mw-blue, #0d6efd);
    box-shadow: 0 0 0 1px #b8c2d1;
    content: '';
}

@media (max-width: 1100px) {
    .stat-grid,
    .form-section,
    .approval-lane,
    .service-machine-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .span-3 {
        grid-column: span 2;
    }
}

@media (max-width: 860px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
    }

    .sidebar > .nav {
        overflow-y: visible;
    }

    .sidebar-card {
        margin-top: 18px;
    }

    .topbar,
    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-actions,
    .toolbar,
    .machine-filter,
    .search-box {
        width: 100%;
    }

    .toolbar .btn,
    .topbar-actions .btn {
        width: 100%;
    }

    .machine-filter .form-select {
        min-width: 0;
        width: 100%;
    }

    .machine-filter .btn {
        width: auto;
    }
}

@media (max-width: 620px) {
    .main-panel {
        padding: 18px;
    }

    .modal-dialog .modal-content > form {
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
    }

    .repair-request-dialog {
        max-width: calc(100% - 12px);
        min-height: calc(100% - 24px);
        margin: 12px 6px;
    }

    .repair-request-dialog .modal-content {
        height: calc(100vh - 24px);
        height: calc(100dvh - 24px);
        max-height: calc(100vh - 24px);
    }
    .machine-modal-dialog {
        max-width: calc(100% - 12px);
        min-height: calc(100% - 24px);
        margin: 12px 6px;
    }

    .machine-modal-dialog .modal-content {
        height: calc(100vh - 24px);
        height: calc(100dvh - 24px);
        max-height: calc(100vh - 24px);
    }

    .stat-grid,
    .form-section,
    .approval-lane,
    .service-machine-summary {
        grid-template-columns: 1fr;
    }

    .span-2,
    .span-3 {
        grid-column: span 1;
    }

    .form-actions {
        flex-direction: column;
    }

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

    .speed-login-grid form:first-child {
        grid-column: span 1;
    }
}
