* {
    font-family: "DM Sans", sans-serif !important;
}

[v-cloak] {
    display: none;
}

html {
    scroll-behavior: smooth;
}

section {
    scroll-snap-align: start;
}

.nav-link {
    position: relative;
    text-decoration: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #10b981;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.swal2-confirm {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}

.swal2-confirm:hover {
    background-color: #059669 !important;
    border-color: #059669 !important;
}

.swal2-confirm:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.4) !important;
}

/* Deny button (secondary action) - subtle green outline */
.swal2-deny {
    background-color: #ffffff !important;
    border: 2px solid #10b981 !important;
    color: #10b981 !important;
}

.swal2-deny:hover {
    background-color: #ecfdf5 !important;
}

/* Cancel button stays neutral */
.swal2-cancel {
    background-color: #e5e7eb !important;
    color: #374151 !important;
}

.swal2-cancel:hover {
    background-color: #d1d5db !important;
}

/* Hide navbar greeting on mobile across role dashboards/pages */
@media (max-width: 639px) {
    .hello-greeting {
        display: none !important;
    }
}

/* Reduce common page title/subtitle sizes on mobile */
@media (max-width: 639px) {
    h1.text-3xl {
        font-size: 1.5rem !important;
        line-height: 2rem !important;
    }

    h1.text-4xl {
        font-size: 1.75rem !important;
        line-height: 2.25rem !important;
    }

    p.text-gray-500.mt-1,
    p.text-gray-500.mt-2,
    p.text-gray-500.mb-6,
    p.text-gray-400.text-sm.mt-1 {
        font-size: 0.875rem !important;
        line-height: 1.25rem !important;
    }
}

/* Hide scrollbar for Chrome, Safari and Opera bg snap horizontal lists */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.hide-scrollbar {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

@keyframes bounce-x {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(3px);
    }
}

.animate-bounce-x {
    animation: bounce-x 1s ease-in-out infinite;
}

.swal2-container {
    z-index: 10000 !important;
}

.modal-root {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1300 !important;
    /* NOTE: no !important on display — Vue v-show hides this with inline
       display:none, which an !important flex would override (modal could
       never close). Inline none beats plain flex; when shown, Vue clears
       the inline style and this flex applies. */
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem;
    overflow: hidden !important;
}

/* Lock body scroll when any modal is open */
body.modal-open {
    overflow: hidden !important;
}

/* Backdrop — the fixed full-screen dim layer (first child, has @click) */
.modal-root>div:first-child:not(:last-child) {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1300 !important;
    background: rgba(0, 0, 0, 0.4) !important;
}

/* Card — the actual modal panel (last child), floats above backdrop */
.modal-root>div:last-child {
    position: relative !important;
    z-index: 1301 !important;
    margin: auto !important;
}

/* .modal-backdrop class (used by some modals instead of inline Tailwind) */
.modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1300 !important;
    background: rgba(0, 0, 0, 0.4) !important;
}

/* Side-drawer (detail panel) transition — shared by user + owner drawers */
.slide-panel-enter-active,
.slide-panel-leave-active {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.slide-panel-enter-from,
.slide-panel-leave-to {
    opacity: 0;
}
.slide-panel-enter-from .detail-panel,
.slide-panel-leave-to .detail-panel {
    transform: translateX(100%);
}
.slide-panel-enter-active .detail-panel,
.slide-panel-leave-active .detail-panel {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Data-table-panel: mobile cards (<768px). Desktop table untouched.
   Cells keep their own font/color/size; labels come from data-label.
   Same border color (gray-100) as desktop. */
@media (max-width: 767px) {
    .dtp {
        background: transparent !important;
        border-color: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
    }
    .dtp .overflow-x-auto { overflow: visible; }
    .dtp table, .dtp tbody { display: block; width: 100%; }
    .dtp thead { display: none; }
    .dtp tbody tr {
        display: block;
        width: 100%;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 1rem;
        box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
        margin-bottom: 0.75rem;
        overflow: hidden;
    }
    .dtp tbody tr:last-child { margin-bottom: 0; }
    .dtp tbody td {
        display: grid;
        grid-template-columns: minmax(100px, 35%) 1fr;
        align-items: center;
        gap: 1rem;
        width: 100%;
        padding: 0.875rem 1.25rem;
        border-bottom: 1px solid #f3f4f6;
    }
    .dtp tbody td:not([data-label]) {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .dtp tbody td::before { display: none; }
    .dtp tbody td[data-label]::before {
        content: attr(data-label);
        display: block;
        flex-shrink: 0;
        font-size: 0.75rem;
        font-weight: 500;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    .dtp tbody td[data-label] > * {
        margin-left: auto;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-align: right;
    }
    .dtp tbody td[data-label] > .flex { justify-content: flex-end; }
    .dtp tbody td[data-label] .truncate { min-width: 0; flex: 1 1 auto; }
    .dtp tbody td:first-child {
        font-weight: 600;
        background-color: #fafafa;
        border-bottom: 1px solid #e5e7eb;
    }
    .dtp tbody td:last-child {
        display: flex;
        justify-content: center;
        border-bottom: 0;
        background: #f9fafb;
    }
    /* Card header title prefix, e.g. "Repair ID #71". Desktop unaffected. */
    .dtp tbody td > [data-card-title]::before { content: attr(data-card-title) " "; }
    /* Opt out of mobile cards per element, e.g. long descriptions. */
    .dtp .dtp-hide-mobile { display: none !important; }
    /* Table wrap: page card holding toolbar + table goes transparent so the
       toolbar header (.ttp) and each row render as separated cards. */
    .tbl-wrap {
        background: transparent !important;
        border-color: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
    }
    .ttp {
        background: #fff;
        border: 1px solid #e5e7eb !important;
        border-radius: 1rem;
        box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
        margin-bottom: 0.75rem;
    }
    /* Labeled values right-align incl. plain text nodes (detail/type/date),
       matching cells that already use text-right. Labels stay left. */
    .dtp tbody td[data-label] { text-align: right; }
    .dtp tbody td[data-label]::before { text-align: left; }
    .dtp tbody td[data-label] > .flex { text-align: left; }
    /* Labeled last cell (e.g. status pill) is a normal row, not footer. */
    .dtp tbody td:last-child[data-label] {
        display: grid;
        background: transparent;
    }
    /* Wrapped + capped values (span.truncate/max-w) flush right like plain
       text instead of leaving a gap at the row edge. */
    .dtp tbody td[data-label] > span { justify-self: end; max-width: 100%; }
    /* Totals card under the table: own white card on mobile. */
    .total-card {
        background: #fff !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 1rem;
        box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    }
}