/* 全站共用版面：背景、頁首、導覽列及通用手機排版 */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body.app-background {
    min-height: 100vh;
    background-image: url("/images/background.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}

.contents {
    min-width: 0;
}

.admin-navbar {
    padding: 10px 22px;
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    border-bottom: 1px solid #334155;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.3);
}

.admin-navbar-brand {
    color: #fff !important;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.admin-navbar-brand:hover {
    color: #93c5fd !important;
}

.admin-navbar .nav-link {
    margin: 0 3px;
    padding: 8px 14px !important;
    color: #dbeafe !important;
    font-weight: 600;
    border-radius: 8px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.admin-navbar .nav-link:hover {
    color: #fff !important;
    background: rgba(96, 165, 250, 0.22);
}

.admin-navbar .nav-link.active,
.admin-navbar .nav-item.show > .nav-link {
    color: #fff !important;
    background: #2563eb;
}

.admin-navbar .dropdown-menu {
    min-width: 200px;
    padding: 8px;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.35);
}

.admin-navbar .dropdown-item {
    padding: 10px 13px;
    color: #e2e8f0;
    font-weight: 500;
    border-radius: 7px;
}

.admin-navbar .dropdown-item:hover,
.admin-navbar .dropdown-item:focus {
    color: #fff;
    background: #334155;
}

.admin-navbar .dropdown-item.active {
    color: #fff;
    background: #2563eb;
}

.admin-navbar .navbar-toggler {
    color: #fff;
    border: 1px solid #64748b;
    border-radius: 8px;
}

.admin-navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.3);
}

.admin-navbar .navbar-toggler-icon {
    filter: brightness(0) invert(1);
}

.navbar-account-area {
    margin-left: 14px;
}

.navbar-system-link {
    padding: 8px 12px;
    color: #dbeafe;
    border: 1px solid rgba(147, 197, 253, 0.3);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.navbar-system-link:hover {
    color: #fff;
    background: rgba(96, 165, 250, 0.18);
    border-color: rgba(147, 197, 253, 0.55);
}

.navbar-user-card {
    padding: 6px 8px 6px 7px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #fff;
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    cursor: pointer;
}

.navbar-user-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1e3a8a;
    background: #dbeafe;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
}

.navbar-user-info {
    min-width: 76px;
    line-height: 1.25;
}

.navbar-user-status,
.navbar-user-account {
    display: block;
}

.navbar-user-status {
    color: #93c5fd;
    font-size: 11px;
}

.navbar-user-status::before {
    width: 6px;
    height: 6px;
    margin-right: 5px;
    display: inline-block;
    background: #4ade80;
    border-radius: 50%;
    content: '';
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.14);
}

.navbar-user-account {
    max-width: 150px;
    overflow: hidden;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar-logout-form {
    margin: 0;
}

.navbar-logout-button {
    min-height: 36px;
    padding: 7px 12px;
    color: #fecaca;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.38);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.navbar-logout-button:hover,
.navbar-logout-button:focus {
    color: #fff;
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: none;
}

/* 寬表格保留欄位可讀性，手機以橫向滑動查看。 */
.package-table-wrap,
.table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-dialog {
    max-width: calc(100% - 1rem);
    margin-right: auto;
    margin-left: auto;
}

.app-date-range {
    white-space: nowrap;
}

.app-date-label {
    display: none;
}

.app-mobile-card-select {
    margin: 0;
}

.app-mobile-card-select-off,
.app-mobile-card-select-on {
    display: none;
}

.app-upload-description {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.app-file-selection {
    color: #64748b;
    font-size: 11px;
}

.app-file-selection.has-files {
    color: #166534;
    font-weight: 700;
}

/* 司機與車輛編輯頁共用的文件預覽／上傳區。 */
.vehicle-document-table {
    overflow: hidden;
    border: 1px solid #ccd6df;
    border-radius: 6px;
    background: #fff;
}

.vehicle-document-row {
    display: grid;
    border-bottom: 1px solid #dbe2e8;
    grid-template-columns: 130px minmax(280px, 1fr) minmax(260px, .8fr);
}

.vehicle-document-row:last-child {
    border-bottom: 0;
}

.vehicle-document-row.is-header {
    background: #e8f1f8;
    color: #294d68;
    font-weight: 700;
}

.vehicle-document-cell {
    min-width: 0;
    padding: 12px;
    border-right: 1px solid #dbe2e8;
}

.vehicle-document-cell:last-child {
    border-right: 0;
}

.vehicle-document-name {
    display: flex;
    background: #f7f9fb;
    font-weight: 700;
    align-items: center;
    justify-content: center;
}

.vehicle-document-preview {
    display: flex;
    width: 100%;
    min-height: 260px;
    max-height: 360px;
    overflow: hidden;
    border: 1px solid #d8e0e7;
    border-radius: 4px;
    background: #f4f6f8;
    color: #6c7883;
    align-items: center;
    justify-content: center;
}

.vehicle-document-preview-cell,
.vehicle-document-upload {
    display: flex;
    flex-direction: column;
}

.vehicle-document-preview-cell {
    gap: 9px;
}

.vehicle-document-preview-cell .vehicle-document-download {
    align-self: flex-start;
}

.vehicle-document-preview img,
.vehicle-document-preview iframe {
    width: 100%;
    height: 100%;
    min-height: 260px;
    border: 0;
    object-fit: contain;
}

.vehicle-document-upload {
    justify-content: flex-start;
    gap: 10px;
}

.vehicle-document-upload small {
    color: #687786;
    line-height: 1.5;
}

.vehicle-document-new-file {
    color: #176a3c;
    font-weight: 700;
}

.app-repeat-field {
    padding: 16px;
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
    background: #f8fafc;
    border: 1px solid #dbe2e8;
    border-radius: 10px;
}

.app-repeat-field__control,
.app-repeat-field__item {
    min-width: 0;
    width: 100%;
    flex: none;
}

.app-repeat-field__list {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (max-width: 850px) {
    .vehicle-document-row,
    .vehicle-document-row.is-header {
        grid-template-columns: 1fr;
    }

    .vehicle-document-row.is-header {
        display: none;
    }

    .vehicle-document-cell {
        border-right: 0;
        border-bottom: 1px solid #dbe2e8;
    }

    .vehicle-document-cell:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 991.98px) {
    body.app-background {
        background-attachment: scroll;
    }

    .admin-navbar {
        padding: 8px 12px;
    }

    .admin-navbar .navbar-toggler {
        padding: 3px 7px;
        font-size: 16px;
    }

    .admin-navbar .navbar-toggler-icon {
        width: 20px;
        height: 20px;
        background-size: 20px 20px;
    }

    .admin-navbar .navbar-collapse {
        position: static;
        width: 100%;
        margin-top: 6px;
        padding: 6px;
        background: rgba(15, 23, 42, 0.96);
        border: 1px solid #334155;
        border-radius: 8px;
    }

    .admin-navbar .navbar-collapse.show,
    .admin-navbar .navbar-collapse.collapsing {
        display: flex;
        align-items: stretch;
        flex-direction: column;
    }

    .admin-navbar .navbar-nav {
        width: 100%;
        max-height: min(52vh, 430px);
        overflow-y: auto;
    }

    .admin-navbar .nav-link {
        margin: 1px 0;
        padding: 6px 9px !important;
        font-size: 13px;
        line-height: 1.35;
    }

    .admin-navbar .dropdown-menu {
        position: static !important;
        width: 100%;
        min-width: 0;
        margin-top: 2px;
        padding: 3px 5px;
        background: #172033;
        border: 0;
        box-shadow: none;
    }

    .admin-navbar .dropdown-item {
        padding: 5px 9px;
        font-size: 13px;
        line-height: 1.35;
    }

    .navbar-account-area {
        order: -1;
        margin-top: 0;
        margin-bottom: 6px;
        margin-left: 0;
        padding-bottom: 6px;
        gap: 5px !important;
        flex-wrap: wrap;
        border-bottom: 1px solid #334155;
    }

    .navbar-system-link {
        padding: 5px 8px;
        font-size: 12px;
    }

    .navbar-user-card {
        padding: 4px 6px;
        gap: 6px;
    }

    .navbar-user-avatar {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
        font-size: 13px;
    }

    .navbar-user-status {
        font-size: 10px;
    }

    .navbar-user-account {
        font-size: 12px;
    }

    .navbar-logout-button {
        min-height: 30px;
        padding: 4px 8px;
        font-size: 12px;
    }
}

@media (max-width: 767.98px) {
    .mobile-order-first {
        order: -1;
    }

    body .app-section-header {
        min-height: 0;
        padding: 10px 12px;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 8px;
    }

    body .app-section-heading {
        min-width: 0;
    }

    body .app-section-title {
        margin: 0;
        font-size: 15px;
        line-height: 1.4;
        overflow-wrap: anywhere;
    }

    body .app-section-description {
        margin: 2px 0 0;
        font-size: 12px;
        line-height: 1.5;
        overflow-wrap: anywhere;
    }

    body .app-section-aside {
        flex: 0 0 auto;
        font-size: 10px;
    }

    body .app-edit-form {
        gap: 10px;
    }

    .app-repeat-field {
        padding: 10px;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .app-repeat-field__control {
        max-width: 140px;
    }

    body .app-edit-form .package-form-row,
    body .app-edit-form .leave-form-grid {
        gap: 8px;
    }

    body .app-edit-form .package-form-group,
    body .app-edit-form .leave-form-group {
        gap: 3px;
    }

    body .app-edit-form label,
    body .app-edit-form .form-label {
        margin-bottom: 3px;
        font-size: 12px;
        line-height: 1.35;
    }

    body .app-edit-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    body .app-edit-form select,
    body .app-edit-form textarea {
        min-height: 34px;
        padding: 5px 7px;
        font-size: 12px;
    }

    body .app-edit-form textarea {
        min-height: 68px;
        line-height: 1.45;
    }

    body .app-edit-form .form-check,
    body .app-edit-form .package-radio-group {
        gap: 6px;
        font-size: 12px;
    }

    .app-inline-crud-form > .row {
        --bs-gutter-x: 6px;
        --bs-gutter-y: 6px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-inline-crud-form > .row > * {
        width: auto;
        max-width: none;
    }

    .app-inline-crud-form > .row > :only-child,
    .app-inline-crud-form > .row > .col-md-8,
    .app-inline-crud-form > .row > .col-md-12 {
        grid-column: 1 / -1;
    }

    .app-inline-crud-form > .d-flex:last-child {
        margin-top: 7px !important;
        gap: 6px !important;
    }

    .app-inline-crud-form > .d-flex:last-child .btn {
        min-width: 0;
        min-height: 32px;
        padding: 4px 8px !important;
        flex: 1 1 0;
        font-size: 12px;
    }

    .app-upload-description {
        font-size: 10px;
        line-height: 1.4;
    }

    .app-upload-form {
        gap: 6px;
    }

    .app-upload-form .package-form-row {
        display: block;
    }

    .app-upload-form .package-form-group {
        padding: 7px 8px;
        gap: 3px;
        background: #f8fafc;
        border: 1px solid #dbe3ee;
        border-radius: 7px;
    }

    .app-upload-form .package-form-group label {
        margin: 0;
        font-size: 11px;
        font-weight: 700;
    }

    body .app-upload-form input[type="file"] {
        min-height: 32px;
        padding: 3px 5px;
        font-size: 11px;
    }

    .app-upload-form input[type="file"]::file-selector-button {
        margin-right: 6px;
        padding: 3px 7px;
        font-size: 11px;
    }

    .app-upload-form .app-file-selection {
        font-size: 9px;
    }

    body .app-edit-form .select2-container {
        width: 100% !important;
        font-size: 12px;
    }

    body .app-edit-form .select2-selection--single {
        min-height: 34px;
    }

    body .app-edit-form .select2-selection--single .select2-selection__rendered {
        line-height: 32px;
    }

    body .app-edit-form .package-form-actions,
    body .app-edit-form .leave-form-actions {
        gap: 6px;
    }

    body .app-edit-form .package-form-actions .btn,
    body .app-edit-form .leave-form-actions .btn {
        min-height: 34px;
        padding: 5px 9px;
        font-size: 12px;
    }

    body .subframe-div > h1.display-5,
    body .subframe-div > h1.subframe-title {
        margin-bottom: 10px !important;
        font-size: 18px;
        line-height: 1.35;
    }

    body .package-div > .text-center > .btn {
        min-height: 32px;
        padding: 4px 9px;
        font-size: 12px;
    }

    body .app-edit-form .vehicle-document-cell {
        padding: 8px;
        font-size: 12px;
    }

    body .app-edit-form .vehicle-document-preview,
    body .app-edit-form .vehicle-document-preview img,
    body .app-edit-form .vehicle-document-preview iframe {
        min-height: 160px;
        max-height: 220px;
    }

    body .app-edit-form .vehicle-document-preview-cell,
    body .app-edit-form .vehicle-document-upload {
        gap: 6px;
    }

    body .app-edit-form .vehicle-document-upload small,
    body .app-edit-form .vehicle-document-new-file {
        font-size: 11px;
    }

    body .app-edit-form .leave-application-section {
        margin-bottom: 8px;
        padding: 10px;
        border-radius: 8px;
    }

    body .app-edit-form .leave-application-section__title {
        margin-bottom: 10px;
        padding-bottom: 6px;
        font-size: 14px;
    }

    body .app-edit-form .leave-field-note,
    body .app-edit-form .leave-description,
    body .app-edit-form .leave-current-attachment {
        min-height: 0;
        font-size: 11px;
    }

    body .app-edit-form .leave-status-badge {
        min-height: 30px;
        padding: 4px 8px;
        font-size: 11px;
    }

    body .app-edit-form .driver-leave-sections {
        gap: 8px;
    }

    body .app-edit-form .driver-leave-toggle {
        padding: 7px 9px;
        font-size: 13px;
    }

    body .app-edit-form .driver-leave-toggle::after {
        font-size: 15px;
    }

    body .app-edit-form .driver-leave-count {
        font-size: 11px;
    }

    body .app-edit-form .driver-leave-body {
        padding: 8px;
    }

    body .app-edit-form .driver-name-search {
        max-width: 100%;
        margin-bottom: 8px;
    }

    .top-banner {
        max-height: 72px;
    }

    .top-banner img {
        min-height: 48px;
        object-fit: cover;
        object-position: center;
    }

    .contents {
        padding-top: 0.5rem !important;
    }

    .package-div,
    .subframe-div {
        width: calc(100% - 16px);
        margin-top: 6px;
        margin-bottom: 8px;
        gap: 10px;
    }

    .subframe-div {
        padding: 10px;
        border-radius: 8px;
    }

    .subframe-title,
    .package-page-title {
        font-size: 17px;
    }

    .subframe-title {
        padding-bottom: 8px;
    }

    .package-form {
        gap: 12px;
    }

    .package-form-row,
    .package-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .package-form-group {
        width: 100%;
        min-width: 0;
        flex-basis: auto;
        gap: 4px;
    }

    .package-form-group label {
        font-size: 13px;
    }

    .package-form input[type="text"],
    .package-form input[type="tel"],
    .package-form input[type="email"],
    .package-form input[type="number"],
    .package-form input[type="date"],
    .package-form input[type="time"],
    .package-form input[type="file"],
    .package-form select,
    .package-form textarea,
    .form-control,
    .form-select {
        min-height: 36px;
        padding: 6px 9px;
        font-size: 14px;
    }

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

    .package-form-actions .btn,
    .package-toolbar .btn,
    .modal-footer .btn {
        min-height: 36px;
        padding: 6px 10px;
        font-size: 14px;
    }

    .package-form-actions .btn:only-child,
    .package-toolbar > .btn:only-child,
    .package-toolbar > a.btn:only-child {
        width: 100%;
    }

    body .app-compact-filter {
        gap: 8px;
    }

    body .app-compact-filter .package-form-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    body .app-compact-filter .package-form-group,
    body .app-compact-filter .field-group {
        width: auto;
        gap: 2px;
    }

    body .app-compact-filter label {
        margin-bottom: 2px;
        font-size: 11px;
        line-height: 1.3;
    }

    body .app-compact-filter input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    body .app-compact-filter select,
    body .app-compact-filter .form-control,
    body .app-compact-filter .form-select {
        min-width: 0;
        min-height: 31px !important;
        padding: 4px 7px !important;
        font-size: 12px !important;
    }

    body .app-compact-filter .package-form-actions {
        gap: 6px;
    }

    body .app-compact-filter .package-form-actions .btn,
    body .app-compact-filter > .btn,
    body .app-compact-filter button,
    body .app-compact-filter a.btn {
        min-height: 32px !important;
        padding: 4px 8px !important;
        font-size: 12px !important;
    }

    .alert.w-50,
    .alert.w-75 {
        width: calc(100% - 16px) !important;
    }

    .modal-dialog {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer,
    .card-body,
    .accordion-body {
        padding: 12px;
    }

    .modal-title {
        font-size: 17px;
    }

    .modal-body {
        max-height: calc(100vh - 150px);
        overflow-y: auto;
    }

    .app-mobile-modal {
        padding: 0 !important;
    }

    .app-mobile-modal .modal-dialog {
        width: calc(100% - 16px);
        max-width: none;
        min-height: calc(100% - 20px);
        margin: 10px auto;
        align-items: flex-end;
    }

    .app-mobile-modal .modal-dialog .modal-content {
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        border-radius: 12px;
    }

    .app-mobile-modal .modal-header,
    .app-mobile-modal .modal-footer {
        flex: 0 0 auto;
    }

    .app-mobile-modal .modal-footer {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .app-mobile-modal .modal-footer > * {
        width: 100%;
        margin: 0;
    }

    .package-table th,
    .package-table td,
    .table th,
    .table td {
        padding: 5px 7px !important;
        font-size: 12px;
    }

    /* 手機資料卡表格：需要的 index 頁面自行加上 app-mobile-card-table。 */
    .app-mobile-card-table-wrap {
        overflow: visible;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .app-mobile-card-table {
        min-width: 0;
        display: block;
        background: transparent;
    }

    .app-mobile-card-table thead {
        display: none;
    }

    .app-mobile-card-table tbody {
        display: grid;
        gap: 8px;
    }

    .app-mobile-card-table tbody tr {
        padding: 8px 10px;
        display: grid;
        background: #fff;
        border: 1px solid #dbe3ee;
        border-left: 4px solid #2563eb;
        border-radius: 8px;
        box-shadow: 0 2px 7px rgba(15, 23, 42, 0.07);
        transform: none !important;
        transition: none !important;
    }

    .app-mobile-card-table tbody tr:nth-child(even) {
        background: #f4f8ff;
    }

    body .app-mobile-card-table tbody tr:hover {
        background: #fff;
    }

    body .app-mobile-card-table tbody tr:nth-child(even):hover {
        background: #f4f8ff;
    }

    .app-mobile-card-table tbody td {
        min-width: 0;
        padding: 6px 0 !important;
        display: grid;
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 8px;
        text-align: right;
        white-space: normal;
        overflow-wrap: anywhere;
        border-right: 0;
        border-bottom: 1px solid #e8edf3 !important;
    }

    .app-mobile-card-table tbody td:last-child {
        border-bottom: 0 !important;
    }

    .app-mobile-card-table tbody td::before {
        color: #64748b;
        font-size: 11px;
        font-weight: 600;
        text-align: left;
        content: attr(data-label);
    }

    .app-mobile-card-table .app-date-range {
        display: grid;
        gap: 2px;
    }

    .app-mobile-card-table .app-date-range > span {
        white-space: nowrap;
    }

    .app-mobile-card-table .app-date-label {
        display: inline;
    }

    .app-mobile-card-table .app-date-range-separator {
        display: none;
    }

    .app-mobile-card-table tbody td.app-mobile-card-actions {
        padding-top: 8px !important;
        display: block;
        text-align: right;
        border-bottom: 0 !important;
    }

    .app-mobile-card-table tbody td.app-mobile-card-actions::before {
        display: none;
    }

    .app-mobile-card-table tbody td.app-mobile-card-actions .btn {
        min-width: 72px;
    }

    .app-mobile-card-table tbody td.app-mobile-card-actions--split {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .app-mobile-card-actions--split > .btn,
    .app-mobile-card-actions--split > form,
    .app-mobile-card-actions--split > form > .btn {
        width: 100%;
        margin: 0;
    }

    .app-mobile-card-table .package-table-empty {
        padding: 18px 8px !important;
        display: block;
        color: #64748b;
        text-align: center;
        border-bottom: 0 !important;
    }

    .app-mobile-card-table .package-table-empty::before {
        display: none;
    }

    .app-mobile-selectable-card-table tbody tr {
        position: relative;
        padding-left: 40px;
        border-left-width: 1px;
    }

    .app-mobile-selectable-card-table .app-mobile-card-select-cell {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 34px;
        padding: 0 !important;
        display: block;
        border-bottom: 0 !important;
    }

    .app-mobile-selectable-card-table .app-mobile-card-select-cell::before {
        display: none;
    }

    .app-mobile-card-select {
        width: 34px;
        height: 100%;
        display: flex;
        align-items: stretch;
        cursor: pointer;
    }

    .app-mobile-selectable-card-table .app-mobile-card-select input {
        position: absolute;
        width: 1px !important;
        height: 1px !important;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
    }

    .app-mobile-card-select-off,
    .app-mobile-card-select-on {
        height: 100%;
        border: 0;
        border-radius: 7px 0 0 7px;
        font-size: 0;
    }

    .app-mobile-card-select-off {
        width: 7px;
        display: block;
        background: #94a3b8;
    }

    .app-mobile-card-select-on {
        width: 11px;
        background: #2563eb;
    }

    .app-mobile-card-select input:checked ~ .app-mobile-card-select-off {
        display: none;
    }

    .app-mobile-card-select input:checked ~ .app-mobile-card-select-on {
        display: block;
    }

    .app-mobile-card-select input:focus-visible ~ span {
        outline: 2px solid #60a5fa;
        outline-offset: 2px;
    }

    .alert {
        padding: 9px 12px;
        font-size: 13px;
    }

    .pagination {
        flex-wrap: wrap;
        row-gap: 5px;
    }
}

@media (max-width: 480px) {
    .admin-navbar-brand {
        max-width: calc(100% - 54px);
        overflow: hidden;
        font-size: 18px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .admin-navbar-brand .badge {
        font-size: 10px;
        vertical-align: middle;
    }

    .navbar-account-area,
    .navbar-system-link,
    .navbar-user-card,
    .navbar-logout-form,
    .navbar-logout-button {
        width: 100%;
    }

    .navbar-system-link,
    .navbar-logout-button {
        text-align: center;
    }

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

    body .app-compact-filter .package-form-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

/* 共用日期與 24 小時制時間欄位 */
.date-time-fields {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.package-form .date-time-fields input[type="date"] {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.package-form .date-time-fields select {
    flex: 0 0 54px;
    width: 54px;
    padding-left: 4px;
    padding-right: 4px;
    text-align: center;
    text-align-last: center;
}

.date-time-fields__separator {
    flex: 0 0 auto;
    font-weight: 600;
}
