* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    background: #f3f4f6;
    color: #111827;
}

a,
button,
summary,
select,
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="file"],
label[for],
[role="button"],
[data-open-camera],
[data-close-camera],
[data-attachment-open],
[data-confirm-message],
.report-action-btn,
.mobile-menu-button,
.camera-start-button,
.camera-fallback-button,
.camera-capture-button,
.camera-stop-button {
    cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled,
textarea:disabled,
[aria-disabled="true"],
.disabled {
    cursor: not-allowed;
}

body.menu-open {
    overflow: hidden;
}

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

.app-content > .bg-white:first-child {
    z-index: 20;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-scroll > table {
    border-collapse: collapse;
}

@media (min-width: 769px) {
    .app-shell {
        min-height: 100vh;
        background: #f3f4f6;
    }

    .app-sidebar {
        flex: 0 0 16rem;
        min-height: 100vh;
        position: sticky;
        top: 0;
        box-shadow: 6px 0 24px rgba(15, 23, 42, 0.12);
    }

    .app-sidebar nav a {
        margin: 0.15rem 0.75rem;
        border-radius: 0.6rem;
        transition: background 140ms ease, transform 140ms ease;
    }

    .app-sidebar nav a:hover {
        transform: translateX(2px);
    }

    .app-content {
        background: #f3f4f6;
    }

    .app-content > .bg-white:first-child {
        margin: 1rem 1.5rem 0;
        border-radius: 0.9rem;
        border: 1px solid #e5e7eb;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    }

    .page-padding {
        padding: 1.5rem !important;
    }

    .rounded-xl,
    .rounded-2xl {
        border-radius: 0.9rem !important;
    }

    .shadow,
    .shadow-xl,
    .shadow-2xl {
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07) !important;
    }

    .table-scroll > table {
        border: 1px solid #e5e7eb;
    }

    thead.bg-gray-50 {
        background: #f8fafc !important;
    }

    th {
        color: #475569;
        font-size: 0.82rem;
        text-transform: uppercase;
        letter-spacing: 0.025em;
    }

    tbody tr:hover {
        background: #f8fafc;
    }

    input,
    select,
    textarea {
        background: #fff;
        transition: border-color 140ms ease, box-shadow 140ms ease;
    }

    input:focus,
    select:focus,
    textarea:focus {
        outline: none;
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
    }

    .report-filter-form {
        display: grid;
        grid-template-columns: minmax(145px, 0.75fr) minmax(145px, 0.7fr) minmax(145px, 0.7fr) minmax(220px, 1.1fr) minmax(260px, 1.35fr);
        gap: 1rem;
        align-items: end;
    }

    .report-filter-form.no-location-filter {
        grid-template-columns: minmax(160px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr);
    }

    .report-filter-actions {
        grid-column: 1 / -1;
        display: flex;
        gap: 0.75rem;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .page-filter-form {
        display: grid;
        grid-template-columns: minmax(145px, 0.75fr) minmax(145px, 0.7fr) minmax(145px, 0.7fr) minmax(220px, 1.1fr) minmax(260px, 1.35fr);
        gap: 1rem;
        align-items: end;
    }

    .page-filter-form.no-location-filter {
        grid-template-columns: minmax(160px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr);
    }

    .request-filter-form {
        grid-template-columns: minmax(240px, 1.25fr) minmax(145px, 0.65fr) minmax(145px, 0.65fr) minmax(145px, 0.65fr) minmax(220px, 1fr) minmax(260px, 1.2fr);
    }

    .request-filter-form.no-location-filter {
        grid-template-columns: minmax(260px, 1.35fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr);
    }

    .stock-filter-form {
        display: grid;
        grid-template-columns: minmax(220px, 1.15fr) minmax(145px, 0.75fr) minmax(145px, 0.7fr) minmax(145px, 0.7fr) minmax(220px, 1fr) minmax(260px, 1.2fr);
        gap: 1rem;
        align-items: end;
    }

    .page-filter-actions {
        grid-column: 1 / -1;
        display: flex;
        gap: 0.75rem;
        justify-content: flex-end;
        flex-wrap: wrap;
    }
}

.attachment-viewer {
    max-height: calc(100vh - 7rem);
}

.attachment-viewer iframe,
.attachment-viewer object {
    min-height: 520px;
}


.report-filter-card,
.page-filter-card,
.report-filter-form,
.page-filter-form,
.stock-filter-form {
    overflow: visible;
}

.location-dropdown {
    position: relative;
    width: 100%;
}

.location-dropdown-toggle {
    width: 100%;
    min-height: 2.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: #fff;
    color: #111827;
    padding: 0.58rem 0.9rem;
    text-align: left;
}

.location-dropdown-toggle span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.location-dropdown-panel {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 60;
    max-height: 18rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.65rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    padding: 0.35rem;
}

.location-dropdown.open .location-dropdown-panel {
    display: block;
}

.location-dropdown.open .location-dropdown-panel {
    position: fixed;
    left: var(--filter-panel-left, 0);
    top: var(--filter-panel-top, 0);
    right: auto;
    width: var(--filter-panel-width, 20rem);
    max-height: var(--filter-panel-max-height, 18rem);
    z-index: 5000;
    overscroll-behavior: contain;
}

.location-option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.55rem 0.6rem;
    border-radius: 0.45rem;
    color: #111827;
    line-height: 1.25;
    cursor: pointer;
}

.location-option:hover {
    background: #f1f5f9;
}

.location-option input {
    flex: 0 0 auto;
    width: 1rem !important;
    height: 1rem !important;
    margin-top: 0.1rem;
    padding: 0 !important;
    border-radius: 0.2rem !important;
}

.location-option span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.location-option-all {
    font-weight: 700;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0.25rem;
}

@media (min-width: 769px) {
    .request-list-scroll,
    .mobile-card-scroll {
        overflow-x: auto;
    }

    .request-list-table,
    .mobile-card-table {
        display: table !important;
        width: 100% !important;
        min-width: 0;
        background: #fff;
    }

    .request-list-table thead,
    .mobile-card-table thead {
        display: table-header-group !important;
    }

    .request-list-table tbody,
    .mobile-card-table tbody {
        display: table-row-group !important;
    }

    .request-list-table tr,
    .mobile-card-table tr {
        display: table-row !important;
    }

    .request-list-table th,
    .request-list-table td,
    .mobile-card-table th,
    .mobile-card-table td {
        display: table-cell !important;
        width: auto !important;
        border-bottom: 1px solid #e5e7eb;
    }

    .request-list-table td::before,
    .mobile-card-table td::before {
        content: none !important;
        display: none !important;
    }

    .dashboard-recent-table td,
    .dashboard-recent-table th {
        vertical-align: middle;
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }

    .dashboard-recent-table th:first-child,
    .dashboard-recent-table td:first-child {
        min-width: 9.75rem;
        white-space: nowrap;
    }

    .dashboard-recent-table th:nth-child(2),
    .dashboard-recent-table td:nth-child(2) {
        min-width: 12rem;
        white-space: nowrap;
    }

    .dashboard-recent-table th[data-dashboard-cost],
    .dashboard-recent-table td[data-dashboard-cost] {
        min-width: 8.75rem;
        white-space: nowrap;
    }

    .dashboard-recent-table th[data-dashboard-status],
    .dashboard-recent-table td[data-dashboard-status] {
        min-width: 8.25rem;
        white-space: nowrap;
    }

    .dashboard-recent-table th[data-dashboard-date],
    .dashboard-recent-table td[data-dashboard-date],
    .dashboard-recent-table th[data-dashboard-action],
    .dashboard-recent-table td[data-dashboard-action] {
        min-width: 5.75rem;
        white-space: nowrap;
    }

    .dashboard-recent-table th[data-dashboard-item],
    .dashboard-recent-table td[data-dashboard-item] {
        min-width: 26rem;
        white-space: normal;
        line-height: 1.45;
    }
}

@media (max-width: 1180px) {
    .grid.md\:grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .grid.lg\:grid-cols-2,
    .grid.lg\:grid-cols-3 {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    body {
        overflow-x: hidden;
        background: #f3f4f6;
    }

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

    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(82vw, 19rem);
        height: 100vh;
        height: 100dvh;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform 180ms ease;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .app-sidebar nav a {
        min-height: 3.15rem;
        font-size: 0.98rem;
        line-height: 1.25;
        word-break: normal;
        overflow-wrap: anywhere;
    }

    .app-content {
        width: 100%;
        min-width: 0;
        padding-top: 0;
        overflow: visible !important;
    }

    .mobile-menu-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.75rem;
        height: 2.75rem;
        top: max(0.75rem, env(safe-area-inset-top)) !important;
        left: max(0.75rem, env(safe-area-inset-left)) !important;
    }

    .mobile-overlay {
        position: fixed;
        inset: 0;
        z-index: 35;
        background: rgba(17, 24, 39, 0.55);
        display: none;
        touch-action: none;
    }

    .mobile-overlay.open {
        display: block;
    }

    .page-padding {
        padding: 0.875rem !important;
    }

    .app-content > .bg-white:first-child {
        padding-left: 4.25rem;
        gap: 0.75rem;
        position: relative;
        z-index: 25;
        min-height: 4rem;
        padding-top: max(1rem, env(safe-area-inset-top));
    }

    .request-toolbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: center !important;
        padding-bottom: 0.75rem !important;
    }

    .request-new-button {
        white-space: nowrap;
        min-height: 2.5rem;
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
        justify-content: center;
    }

    .status-filter-bar {
        margin-top: 0;
        overflow-x: auto;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .status-filter-bar a {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .app-content > .bg-white:first-child h1 {
        font-size: 1.15rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .rounded-2xl {
        border-radius: 0.75rem !important;
    }

    .shadow-xl,
    .shadow-2xl {
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08) !important;
    }

    .max-w-2xl,
    .max-w-3xl,
    .max-w-4xl {
        max-width: 100% !important;
    }

    .p-8 {
        padding: 1rem !important;
    }

    .p-6 {
        padding: 0.875rem !important;
    }

    .px-6 {
        padding-left: 0.875rem !important;
        padding-right: 0.875rem !important;
    }

    .py-3 {
        padding-top: 0.65rem !important;
        padding-bottom: 0.65rem !important;
    }

    .text-3xl {
        font-size: 1.35rem !important;
        line-height: 1.45 !important;
    }

    .text-2xl {
        font-size: 1.2rem !important;
        line-height: 1.4 !important;
    }

    input,
    select,
    textarea,
    button,
    a {
        max-width: 100%;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
        border-radius: 0.65rem !important;
        padding: 0.8rem !important;
    }

    button,
    .rounded-lg {
        border-radius: 0.65rem !important;
    }

    .grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .report-filter-form,
    .page-filter-form,
    .stock-filter-form {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 0.85rem !important;
    }

    .page-filter-actions {
        justify-content: stretch !important;
    }

    .page-filter-actions > * {
        flex: 1 1 100%;
    }

    .report-filter-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem !important;
        justify-content: stretch !important;
    }

    .report-filter-actions > .report-action-btn {
        width: 100%;
        min-width: 0;
        min-height: 2.85rem;
        padding-left: 0.55rem !important;
        padding-right: 0.55rem !important;
        font-size: 0.9rem;
    }


    .table-scroll {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 0.75rem;
    }

    .table-scroll > table {
        min-width: 640px;
    }

    .detail-table > table {
        min-width: 0;
    }

    .detail-table td {
        display: block;
        width: 100%;
        padding: 0.35rem 0;
    }

    .detail-table td:first-child {
        color: #4b5563;
    }

    .mobile-stack {
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-stack > * {
        width: 100%;
    }

    .mobile-grid-one {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .flex.gap-4,
    .flex.gap-3,
    form.flex {
        flex-wrap: wrap;
    }

    .flex-1 {
        min-width: 0;
    }

    .px-10 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .request-submit-row {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 2.9rem;
        z-index: 34;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 0.75rem !important;
        padding: 0.75rem 0.875rem max(0.85rem, env(safe-area-inset-bottom)) !important;
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
    }

    .request-submit-button,
    .request-cancel-button {
        display: flex;
        width: 100%;
        min-height: 3.15rem;
        align-items: center;
        justify-content: center;
        font-size: 1rem !important;
        line-height: 1.2 !important;
    }

    .request-create-form {
        padding-bottom: 12.5rem;
    }

    .app-form-with-actions {
        padding-bottom: 5.5rem !important;
    }

    .form-action-row {
        margin-bottom: 3.5rem;
    }

    .form-action-row > * {
        flex: 1 1 100%;
        text-align: center;
        justify-content: center;
    }

    .request-list-scroll {
        overflow: visible;
    }

    .request-list-table {
        min-width: 0 !important;
        display: block;
        background: transparent !important;
        box-shadow: none !important;
    }

    .request-list-table thead {
        display: none;
    }

    .request-list-table tbody,
    .request-list-table tr,
    .request-list-table td {
        display: block;
        width: 100%;
    }

    .request-list-table tr {
        margin-bottom: 0.9rem;
        padding: 0.85rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.95rem;
        background: #fff;
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    }

    .request-list-table td {
        padding: 0.45rem 0 !important;
        border: 0 !important;
        text-align: left !important;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .request-list-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.15rem;
        color: #6b7280;
        font-size: 0.78rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }

    .request-list-table td[data-label="Action"] {
        display: flex;
        gap: 0.75rem;
        align-items: center;
        flex-wrap: wrap;
        padding-top: 0.75rem !important;
    }

    .mobile-card-scroll {
        overflow: visible;
    }

    .mobile-card-table {
        min-width: 0 !important;
        display: block;
        background: transparent !important;
        box-shadow: none !important;
    }

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

    .mobile-card-table tbody,
    .mobile-card-table tr,
    .mobile-card-table td {
        display: block;
        width: 100%;
    }

    .mobile-card-table tr {
        margin-bottom: 0.9rem;
        padding: 0.85rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.95rem;
        background: #fff;
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    }

    .mobile-card-table td {
        padding: 0.45rem 0 !important;
        border: 0 !important;
        text-align: left !important;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .mobile-card-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.15rem;
        color: #6b7280;
        font-size: 0.78rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }

    .mobile-card-table td[data-label="Action"] {
        display: flex;
        gap: 0.75rem;
        align-items: center;
        flex-wrap: wrap;
        padding-top: 0.75rem !important;
    }

    .py-4 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .attachment-viewer {
        max-height: none;
    }

    .attachment-viewer iframe,
    .attachment-viewer object {
        height: 72vh !important;
        height: 72dvh !important;
        min-height: 420px;
    }

    .attachment-viewer img {
        max-height: 72vh !important;
    }
}

@media (max-width: 430px) {
    html {
        font-size: 14px;
    }

    .app-content > .bg-white:first-child {
        padding-right: 0.75rem;
    }

    .text-5xl {
        font-size: 2rem !important;
    }

    .table-scroll > table {
        min-width: 560px;
    }

    .detail-table > table {
        min-width: 0;
    }
}

@media (max-width: 380px) {
    .request-toolbar {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 0.5rem;
        align-items: stretch !important;
    }

    .request-new-button {
        width: 100%;
    }
}

@media (min-width: 769px) {
    .mobile-menu-button,
    .mobile-overlay {
        display: none;
    }
}


@media (min-width: 769px) {
    .request-view-card {
        width: 100% !important;
        max-width: none !important;
        min-height: calc(100vh - 6.75rem);
        min-height: calc(100dvh - 6.75rem);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .request-view-card > .grid.grid-cols-2 {
        gap: 1.5rem !important;
    }

    .request-attachment-row {
        display: grid;
        grid-template-columns: minmax(14rem, 1fr) auto;
        align-items: center;
        gap: 1rem;
        margin-top: 1.15rem;
        padding-top: 1.15rem;
        border-top: 1px solid #0f172a;
    }

    .request-attachment-row h3 {
        margin: 0;
        font-size: 0.98rem;
    }

    .request-attachment-row > div:first-child {
        display: contents;
    }

    .request-attachment-row > div:first-child > div:last-child {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 0.65rem !important;
        width: auto !important;
    }

    .request-attachment-row button,
    .request-attachment-row a {
        white-space: nowrap;
        min-height: 2.35rem;
        padding: 0.55rem 1rem !important;
        line-height: 1.1;
    }

    .request-view-card .detail-table {
        overflow: visible;
    }

    .request-view-card .detail-table > table {
        min-width: 0;
        table-layout: fixed;
        border: 1px solid #e5e7eb;
    }

    .request-view-card .detail-table td:first-child {
        width: 10.5rem;
        white-space: nowrap;
        vertical-align: top;
    }

    .request-view-card .detail-table td:last-child {
        overflow-wrap: anywhere;
    }
}

.app-content {
    padding-bottom: 3.75rem;
}

.app-footer {
    position: fixed;
    left: 16rem;
    right: 0;
    bottom: 0;
    z-index: 30;
    margin: 0;
    padding: 0.7rem 1rem;
    color: #475569;
    font-size: 0.85rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.94);
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(8px);
}

@media (max-width: 768px) {
    .app-content {
        padding-bottom: 4.25rem;
    }

    .app-footer {
        left: 0;
        right: 0;
        bottom: 0;
        padding: 0.75rem 0.75rem max(0.75rem, env(safe-area-inset-bottom));
        font-size: 0.82rem;
    }
}

/* Global UI refresh - 2026-05-11 */
:root {
    --ui-bg: #eef3f8;
    --ui-surface: #ffffff;
    --ui-surface-soft: #f8fafc;
    --ui-text: #172033;
    --ui-muted: #64748b;
    --ui-border: #dbe4ef;
    --ui-primary: #2563eb;
    --ui-primary-dark: #1d4ed8;
    --ui-success: #059669;
    --ui-danger: #dc2626;
    --ui-warning: #d97706;
    --ui-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    --ui-shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.06);
}

html {
    background: var(--ui-bg);
}

body {
    color: var(--ui-text);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.72) 0%, rgba(238,243,248,0.94) 34%, #eef3f8 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
    background: transparent !important;
}

.app-sidebar {
    background: linear-gradient(180deg, #111827 0%, #162238 58%, #101827 100%) !important;
    border-right: 1px solid rgba(255,255,255,0.08);
}

.app-sidebar > .p-6 {
    min-height: 5rem;
    display: flex;
    align-items: center;
    color: #f8fafc;
    border-bottom-color: rgba(255,255,255,0.1) !important;
    letter-spacing: 0;
}

.app-sidebar nav {
    padding: 0.5rem 0.75rem 1.25rem;
}

.app-sidebar nav a {
    margin: 0.2rem 0;
    border-radius: 0.8rem;
    color: #dbeafe;
    background: transparent;
    font-weight: 650;
    letter-spacing: 0;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.app-sidebar nav a i {
    width: 1.3rem;
    color: #93c5fd;
    text-align: center;
}

.app-sidebar nav a:hover {
    background: rgba(37, 99, 235, 0.16) !important;
    color: #ffffff;
    transform: translateX(3px);
}

.app-sidebar nav a.bg-gray-800,
.app-sidebar nav a.bg-gray-800:hover {
    background: linear-gradient(135deg, #2563eb 0%, #0f766e 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
}

.app-sidebar nav a.bg-gray-800 i {
    color: #ffffff;
}

.app-content {
    background: transparent !important;
    min-height: 100vh;
}

.app-content > .bg-white:first-child {
    min-height: 4.75rem;
    background: rgba(255, 255, 255, 0.94) !important;
    border: 1px solid rgba(219, 228, 239, 0.96);
    box-shadow: var(--ui-shadow-soft) !important;
    backdrop-filter: blur(12px);
}

.app-content > .bg-white:first-child h1 {
    color: #0f172a;
    font-weight: 800;
    letter-spacing: 0;
}

.page-padding {
    max-width: 1600px;
    margin: 0 auto;
}

.bg-white.rounded-xl,
.bg-white.rounded-2xl,
.report-filter-card,
.page-filter-card,
.table-scroll > table,
.mobile-card-table,
.request-list-table {
    background: var(--ui-surface) !important;
    border: 1px solid var(--ui-border);
    box-shadow: var(--ui-shadow-soft) !important;
}

.bg-white.rounded-xl,
.bg-white.rounded-2xl,
.report-filter-card,
.page-filter-card {
    border-radius: 1rem !important;
}

.grid .bg-white.p-6.rounded-2xl {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--ui-border);
    box-shadow: var(--ui-shadow-soft) !important;
}

.grid .bg-white.p-6.rounded-2xl::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ui-primary), #0f766e, #f59e0b);
}

.grid .bg-white.p-6.rounded-2xl h3 {
    color: var(--ui-muted);
    font-weight: 750;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.grid .bg-white.p-6.rounded-2xl p {
    color: #0f172a;
    letter-spacing: 0;
}

label,
.block.text-sm.font-medium {
    color: #334155;
    font-weight: 750 !important;
    letter-spacing: 0;
}

input,
select,
textarea,
.location-dropdown-toggle {
    min-height: 2.8rem;
    color: #0f172a;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0.8rem !important;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

input:hover,
select:hover,
textarea:hover,
.location-dropdown-toggle:hover {
    border-color: #94a3b8 !important;
}

input:focus,
select:focus,
textarea:focus,
.location-dropdown.open .location-dropdown-toggle {
    border-color: var(--ui-primary) !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14) !important;
    outline: none !important;
}

select:disabled,
input:disabled,
textarea:disabled {
    color: #94a3b8;
    background: #f1f5f9 !important;
    cursor: not-allowed;
}

input[type="file"] {
    padding: 0.85rem !important;
    background: #f8fafc !important;
}

button,
a.bg-blue-600,
a.bg-gray-600,
a.bg-red-600,
a.bg-green-600,
a.bg-gray-200,
a.bg-gray-500,
button.bg-blue-600,
button.bg-red-600,
button.bg-green-600 {
    border-radius: 0.8rem !important;
    font-weight: 750;
    letter-spacing: 0;
    transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

button:hover,
a.bg-blue-600:hover,
a.bg-gray-600:hover,
a.bg-red-600:hover,
a.bg-green-600:hover,
a.bg-gray-500:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.13);
}

.bg-blue-600,
.hover\:bg-blue-700:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
}

.bg-green-600,
.hover\:bg-green-700:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
}

.bg-red-600,
.hover\:bg-red-700:hover,
.bg-red-500,
.hover\:bg-red-600:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
}

.bg-gray-600,
.bg-gray-500,
.hover\:bg-gray-700:hover,
.hover\:bg-gray-600:hover {
    background: linear-gradient(135deg, #475569, #334155) !important;
}

.bg-gray-200 {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

.table-scroll {
    border-radius: 1rem;
    box-shadow: var(--ui-shadow-soft);
    background: #ffffff;
}

.table-scroll > table {
    border-radius: 1rem;
    overflow: hidden;
    border-collapse: separate !important;
    border-spacing: 0;
}

thead.bg-gray-50,
thead tr {
    background: #f8fafc !important;
}

th {
    color: #475569 !important;
    font-size: 0.78rem !important;
    font-weight: 850 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em !important;
    border-bottom: 1px solid var(--ui-border);
}

td {
    color: #172033;
    border-bottom-color: #edf2f7 !important;
}

tbody tr {
    transition: background-color 140ms ease;
}

tbody tr:hover {
    background: #f8fbff !important;
}

.rounded-full.text-xs,
td span.rounded-full {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.55rem;
    border-radius: 999px !important;
    font-weight: 850 !important;
    letter-spacing: 0.02em;
}

.location-dropdown-panel {
    border-radius: 0.95rem;
    border-color: #cbd5e1;
    box-shadow: 0 24px 55px rgba(15, 23, 42, 0.18);
    padding: 0.5rem;
}

.location-option {
    min-height: 2.65rem;
    border-radius: 0.7rem;
    transition: background-color 140ms ease;
}

.location-option:hover {
    background: #eef6ff;
}

.location-option input[type="checkbox"] {
    accent-color: var(--ui-primary);
}

.report-filter-actions,
.page-filter-actions,
.form-action-row,
.request-submit-row {
    align-items: center;
}

.report-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-width: 5.1rem;
    white-space: nowrap;
    line-height: 1.2;
}

.bg-green-100,
.bg-red-100,
.bg-yellow-100,
.bg-purple-100 {
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.mobile-menu-button {
    border: 1px solid rgba(255,255,255,0.12);
    background: #111827 !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28) !important;
}

.app-footer {
    color: #475569;
    background: rgba(255,255,255,0.9);
}

body.bg-gray-900 {
    min-height: 100vh;
    color: #f8fafc;
    background: linear-gradient(135deg, #0f172a 0%, #172033 52%, #0f766e 160%) !important;
}

body.bg-gray-900 .bg-gray-800 {
    background: rgba(15, 23, 42, 0.82) !important;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 28px 70px rgba(0,0,0,0.34) !important;
    backdrop-filter: blur(14px);
}

body.bg-gray-900 input {
    color: #ffffff;
    background: rgba(51,65,85,0.9) !important;
    border-color: rgba(148,163,184,0.35) !important;
}

@media (min-width: 769px) {
    .app-content > .bg-white:first-child {
        position: sticky;
        top: 1rem;
        z-index: 28;
    }

    .report-filter-card,
    .page-filter-card {
        padding: 1.25rem !important;
    }
}

@media (max-width: 768px) {
    body {
        background: #f4f7fb !important;
    }

    .app-sidebar {
        width: min(86vw, 20rem);
        border-radius: 0 1.15rem 1.15rem 0;
    }

    .app-content > .bg-white:first-child {
        margin: 0.75rem 0.75rem 0;
        border-radius: 1rem;
        min-height: 4.35rem;
        padding-left: 4rem !important;
        box-shadow: var(--ui-shadow-soft) !important;
    }

    .page-padding {
        padding: 0.85rem !important;
    }

    .bg-white.rounded-xl,
    .bg-white.rounded-2xl,
    .report-filter-card,
    .page-filter-card {
        border-radius: 1rem !important;
    }

    .request-list-table tr,
    .mobile-card-table tr {
        border-radius: 1rem;
        box-shadow: var(--ui-shadow-soft) !important;
    }

    .request-list-table td::before,
    .mobile-card-table td::before {
        color: #64748b;
        font-size: 0.73rem;
    }

    .location-dropdown-panel {
        position: fixed;
        left: 0.85rem;
        right: 0.85rem;
        top: auto;
        bottom: calc(4.3rem + env(safe-area-inset-bottom));
        max-height: min(62vh, 30rem);
        z-index: 80;
    }

    .request-submit-row {
        bottom: calc(3.25rem + env(safe-area-inset-bottom));
        border-radius: 1rem 1rem 0 0;
    }

    .request-create-form,
    .app-form-with-actions {
        padding-bottom: 13.5rem !important;
    }

    .app-footer {
        box-shadow: 0 -10px 24px rgba(15,23,42,0.08);
    }
}

.filter-search-wrap {
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 0.25rem 0.25rem 0.5rem;
    background: #ffffff;
}

.filter-search-input {
    width: 100%;
    min-height: 2.45rem;
    padding: 0.65rem 0.8rem !important;
    border-radius: 0.7rem !important;
    font-size: 0.92rem !important;
}

.location-dropdown-panel .location-option-all {
    position: sticky;
    top: 3.2rem;
    z-index: 3;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.location-option.is-hidden {
    display: none;
}

.location-option.is-match {
    background: #eef6ff;
}


/* Desktop shell correction - keep sidebar full height with proper content padding */
@media (min-width: 769px) {
    .app-shell {
        display: block !important;
        min-height: 100vh;
    }

    .app-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 16rem !important;
        height: 100vh !important;
        min-height: 100vh !important;
        overflow-y: auto;
        z-index: 50;
    }

    .app-content {
        width: calc(100% - 16rem) !important;
        min-height: 100vh;
        margin-left: 16rem !important;
        overflow: visible !important;
    }

    .app-content > .bg-white:first-child {
        margin: 1rem 1.5rem 0 !important;
    }

    .app-footer {
        left: 16rem !important;
    }
}

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

    .app-content {
        width: 100% !important;
        margin-left: 0 !important;
    }
}

/* EMTS brand layer - logo based palette */
:root {
    --ui-bg: #eef3f0;
    --ui-surface: #ffffff;
    --ui-surface-soft: #f7faf4;
    --ui-text: #1f2933;
    --ui-muted: #667085;
    --ui-border: #dbe5d3;
    --ui-primary: #a9d32f;
    --ui-primary-dark: #82ad17;
    --ui-primary-ink: #172033;
    --ui-success: #5f9f1b;
    --ui-danger: #c62828;
    --ui-warning: #b7791f;
    --ui-shadow: 0 18px 45px rgba(31, 41, 51, 0.08);
    --ui-shadow-soft: 0 10px 28px rgba(31, 41, 51, 0.06);
}

body {
    background: linear-gradient(180deg, #f8fbf3 0%, #eef3f0 45%, #e9f0eb 100%) !important;
}

.app-sidebar {
    background: linear-gradient(180deg, #22252b 0%, #172033 58%, #111827 100%) !important;
}

.app-sidebar > .p-6 {
    color: #ffffff;
    border-bottom-color: rgba(169, 211, 47, 0.18) !important;
}

.app-sidebar nav a {
    color: #e5ecdc;
}

.app-sidebar nav a i {
    color: #b7dc4a;
}

.app-sidebar nav a:hover {
    background: rgba(169, 211, 47, 0.14) !important;
    color: #ffffff;
}

.app-sidebar nav a.bg-gray-800,
.app-sidebar nav a.bg-gray-800:hover {
    background: linear-gradient(135deg, #a9d32f 0%, #6f9e16 100%) !important;
    color: #172033 !important;
    box-shadow: 0 14px 30px rgba(130, 173, 23, 0.28);
}

.app-sidebar nav a.bg-gray-800 i {
    color: #172033;
}

.mobile-menu-button {
    background: #22252b !important;
    border-color: rgba(169, 211, 47, 0.28) !important;
}

.app-content > .bg-white:first-child,
.bg-white.rounded-xl,
.bg-white.rounded-2xl,
.report-filter-card,
.page-filter-card,
.table-scroll > table,
.mobile-card-table,
.request-list-table {
    border-color: #dbe5d3 !important;
}

thead.bg-gray-50,
thead tr {
    background: #f6faef !important;
}

th {
    color: #46513d !important;
}

tbody tr:hover {
    background: #fbfdf6 !important;
}

input:focus,
select:focus,
textarea:focus,
.location-dropdown.open .location-dropdown-toggle {
    border-color: #a9d32f !important;
    box-shadow: 0 0 0 4px rgba(169, 211, 47, 0.22) !important;
}

.location-option:hover,
.location-option.is-match {
    background: #f1f8dd !important;
}

.location-option input[type="checkbox"] {
    accent-color: #82ad17;
}

.bg-blue-600,
.hover\:bg-blue-700:hover,
button.bg-blue-600,
a.bg-blue-600 {
    background: linear-gradient(135deg, #a9d32f, #82ad17) !important;
    color: #172033 !important;
}

.text-blue-600 {
    color: #6f9e16 !important;
}

.hover\:text-blue-800:hover,
.hover\:text-blue-600:hover {
    color: #557d0f !important;
}

.bg-green-600,
.hover\:bg-green-700:hover {
    background: linear-gradient(135deg, #6f9e16, #4f7d0d) !important;
    color: #ffffff !important;
}

.border-blue-500,
.border-green-500 {
    border-color: #a9d32f !important;
}

.text-blue-600,
.text-green-600 {
    color: #6f9e16 !important;
}

.bg-green-100 {
    background: #edf8d2 !important;
    color: #476f0d !important;
}

.bg-yellow-100 {
    background: #fff4c2 !important;
    color: #8a5d00 !important;
}

.bg-purple-100 {
    background: #ecf5dc !important;
    color: #5f7d14 !important;
}

.app-footer {
    border-top-color: rgba(169, 211, 47, 0.24);
}

body.login-page {
    background:
        radial-gradient(circle at 50% 0%, rgba(169, 211, 47, 0.24), transparent 34%),
        linear-gradient(135deg, #f8fbf1 0%, #eef7db 48%, #f7fbed 100%) !important;
}

.login-card,
body.login-page .login-card {
    background: rgba(255, 255, 255, 0.98) !important;
    color: #22252b !important;
    border: 1px solid rgba(169, 211, 47, 0.32) !important;
    box-shadow: 0 26px 70px rgba(91, 118, 25, 0.18) !important;
}

.login-brand {
    display: grid;
    justify-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.login-logo {
    width: min(15rem, 72vw);
    max-height: 9rem;
    object-fit: contain;
}

body.login-page .login-card label {
    color: #344054 !important;
}

body.login-page .login-card input {
    color: #172033 !important;
    background: #fbfdf7 !important;
    border-color: #cddbbd !important;
}

body.login-page .login-card input:focus {
    border-color: #a9d32f !important;
    box-shadow: 0 0 0 4px rgba(169, 211, 47, 0.24) !important;
}

body.login-page .login-card button[type="submit"] {
    background: linear-gradient(135deg, #a9d32f, #82ad17) !important;
    color: #172033 !important;
    box-shadow: 0 16px 34px rgba(130, 173, 23, 0.24);
}

.login-footer {
    backdrop-filter: blur(10px);
}

.dashboard-stat-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.dashboard-stat-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12) !important;
}

.dashboard-drilldown-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.dashboard-drilldown-summary span {
    display: inline-flex;
    align-items: center;
    min-height: 2.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: #eef6df;
    color: #334155;
    font-weight: 800;
    font-size: 0.88rem;
}

.district-section,
.site-section {
    background: #fff;
    border: 1px solid #dfe9d8;
    border-radius: 1rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    margin-bottom: 1rem;
}

.district-section > summary,
.site-section > summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.2rem;
    font-weight: 900;
    color: #0f172a;
}

.district-section > summary::-webkit-details-marker,
.site-section > summary::-webkit-details-marker {
    display: none;
}

.district-section > summary {
    background: linear-gradient(135deg, #f8fff0, #eef7e8);
}

.site-section {
    box-shadow: none;
    margin: 1rem;
}

.site-section > summary {
    background: #fbfdf8;
    border-bottom: 1px solid #e8efe3;
}

.site-list {
    padding: 0.25rem 0;
}

.dashboard-drilldown-table {
    background: #fff;
}

.dashboard-drilldown-table th,
.dashboard-drilldown-table td {
    padding-left: 1rem;
    padding-right: 1rem;
}

.request-status-timeline {
    padding: 1.05rem;
    border: 1px solid #dfe9d8;
    border-radius: 1rem;
    background: linear-gradient(180deg, #ffffff, #f8fbf4);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
}

.status-timeline-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding-bottom: 0.9rem;
    margin-bottom: 0.9rem;
    border-bottom: 1px solid #e5efd9;
}

.status-timeline-kicker {
    display: block;
    color: #65a30d;
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0;
    margin-bottom: 0.2rem;
}

.status-timeline-header h3 {
    color: #0f172a;
    font-size: 1.05rem;
    line-height: 1.2;
    font-weight: 900;
    margin: 0;
}

.status-timeline-current {
    flex: 0 0 auto;
    border-radius: 999px;
    background: #e8f3d1;
    color: #3f6212;
    padding: 0.35rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 900;
}

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

.request-view-card .grid.grid-cols-2 > div .request-status-timeline .status-stamp-grid {
    grid-template-columns: minmax(0, 1fr);
}

.status-stamp-track {
    position: relative;
    gap: 0.75rem;
}

.status-stamp-track::before {
    content: "";
    position: absolute;
    top: 1.4rem;
    bottom: 1.4rem;
    left: 0.62rem;
    width: 2px;
    background: linear-gradient(180deg, #84cc16, #d9e8c0);
}

.status-stamp-card {
    position: relative;
    border: 1px solid #e2e8f0;
    border-left-width: 0;
    border-radius: 0.9rem;
    padding: 0.85rem 0.9rem 0.85rem 2.2rem;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.status-stamp-dot {
    position: absolute;
    left: 0.18rem;
    top: 1rem;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    background: #84cc16;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #84cc16;
    z-index: 1;
}

.status-stamp-label {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0;
}

.status-stamp-state {
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 900;
    margin-top: 0.25rem;
}

.status-stamp-meta,
.status-stamp-date,
.status-stamp-reason {
    margin-top: 0.35rem;
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.35;
}

.status-stamp-reason {
    color: #7c2d12;
    background: #fff7ed;
    border-radius: 0.65rem;
    padding: 0.55rem 0.7rem;
}

.status-stamp-success .status-stamp-dot {
    background: #84cc16;
    box-shadow: 0 0 0 2px #84cc16;
}

.status-stamp-danger .status-stamp-dot {
    background: #dc2626;
    box-shadow: 0 0 0 2px #dc2626;
}

.status-stamp-info .status-stamp-dot {
    background: #2563eb;
    box-shadow: 0 0 0 2px #2563eb;
}

.status-stamp-warning .status-stamp-dot {
    background: #f59e0b;
    box-shadow: 0 0 0 2px #f59e0b;
}

.status-notes-card,
.purpose-notes-card {
    margin-top: 0.9rem;
    border-radius: 0.9rem;
    border: 1px solid #e5efd9;
    background: #fbfdf8;
    padding: 0.85rem 0.95rem;
}

.status-notes-card span {
    display: block;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.status-notes-card p,
.purpose-notes-card p {
    margin: 0;
    color: #1f2937;
    line-height: 1.45;
}

.request-detail-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    border: 1px solid #dfe9d8;
    border-radius: 1rem;
    padding: 0.9rem;
    background: linear-gradient(180deg, #ffffff, #fbfdf8);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
}

.request-detail-row {
    min-width: 0;
    border: 1px solid #edf4e4;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.82);
    padding: 0.75rem 0.85rem;
}

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

.request-detail-row span {
    display: block;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.request-detail-row strong {
    display: block;
    color: #0f172a;
    font-size: 0.95rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.request-detail-status {
    display: inline-flex !important;
    width: fit-content;
    border-radius: 999px;
    background: #e8f3d1;
    color: #3f6212 !important;
    padding: 0.25rem 0.65rem;
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
}

.request-detail-alert {
    border-color: #fecaca;
    background: #fff5f5;
}

.request-detail-alert strong,
.request-detail-alert span {
    color: #991b1b;
}

.request-detail-warning {
    border-color: #fed7aa;
    background: #fff7ed;
}

.request-detail-warning strong,
.request-detail-warning span {
    color: #9a3412;
}

.users-search-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 1rem;
    align-items: end;
}

.users-search-actions {
    display: flex;
    gap: 0.75rem;
}

.users-list-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.users-list-summary span {
    display: inline-flex;
    align-items: center;
    min-height: 2.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: #eef6df;
    color: #334155;
    font-weight: 800;
    font-size: 0.88rem;
}

.users-district-section,
.users-site-section {
    background: #fff;
    border: 1px solid #dfe9d8;
    border-radius: 1rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    margin-bottom: 1rem;
}

.users-district-section > summary,
.users-site-section > summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.2rem;
    font-weight: 900;
    color: #0f172a;
}

.users-district-section > summary::-webkit-details-marker,
.users-site-section > summary::-webkit-details-marker {
    display: none;
}

.users-district-section > summary {
    background: linear-gradient(135deg, #f8fff0, #eef7e8);
}

.users-site-section {
    margin: 1rem;
    box-shadow: none;
}

.users-site-section > summary {
    background: #fbfdf8;
    border-bottom: 1px solid #e8efe3;
}

.users-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.user-card {
    border: 1px solid #e4ecd9;
    border-radius: 1rem;
    background: #fff;
    padding: 1rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.user-card-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    border-bottom: 1px solid #edf4e4;
    padding-bottom: 0.85rem;
    margin-bottom: 0.85rem;
}

.user-card h3 {
    margin: 0;
    color: #0f172a;
    font-weight: 900;
    font-size: 1rem;
    line-height: 1.25;
}

.user-card p {
    margin: 0.25rem 0 0;
    color: #64748b;
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

.user-status-pill {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 900;
}

.user-status-pill.is-active {
    background: #e8f3d1;
    color: #3f6212;
}

.user-status-pill.is-inactive {
    background: #e5e7eb;
    color: #334155;
}

.user-card-meta {
    display: grid;
    gap: 0.75rem;
}

.user-card-meta span {
    display: block;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.user-card-meta strong {
    color: #0f172a;
    font-size: 0.92rem;
    line-height: 1.35;
}

.user-card-meta em {
    display: inline-flex;
    margin-left: 0.25rem;
    color: #3f6212;
    font-style: normal;
    font-weight: 900;
}

.user-card-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.user-search-hit {
    background: #fef08a;
    color: #713f12;
    border-radius: 0.25rem;
    padding: 0 0.14rem;
}

.request-search-hit {
    background: #fef08a;
    color: #713f12;
    border-radius: 0.25rem;
    padding: 0 0.16rem;
    font-weight: 900;
}

.filter-input-error,
.filter-input-error:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16) !important;
    background: #fff7f7 !important;
}

.request-tag-cell {
    max-width: 17rem;
    overflow-wrap: anywhere;
    font-weight: 700;
    color: #334155;
}

.user-create-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: grid;
    place-items: start center;
    padding: 5rem 1rem 1.5rem;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    pointer-events: none;
    overflow-y: auto;
    transition: opacity 160ms ease;
}

.user-create-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.user-create-card {
    width: min(100%, 62rem);
    border: 1px solid #dfe9d8;
    border-radius: 1.2rem;
    background: #fff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
    padding: 1.25rem;
}

.user-create-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e5efd9;
}

.user-create-head span {
    display: block;
    color: #65a30d;
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.user-create-head h2 {
    margin: 0.15rem 0 0;
    color: #0f172a;
    font-weight: 900;
    font-size: 1.35rem;
}

.user-create-close {
    border: 0;
    border-radius: 0.75rem;
    background: #334155;
    color: #fff;
    min-height: 2.65rem;
    padding: 0.65rem 1rem;
    font-weight: 900;
    cursor: pointer;
}

.user-create-actions {
    display: flex;
    align-items: end;
    gap: 0.75rem;
}

body.modal-open {
    overflow: hidden;
}

.attachment-overlay {
    margin-top: 1.25rem;
    border: 1px solid #dbe5d3;
    border-radius: 1rem;
    overflow: hidden;
    background: #f8fafc;
}

.attachment-overlay.is-overlay {
    --attachment-overlay-top: clamp(4.25rem, 8vh, 6.5rem);
    --attachment-overlay-x: clamp(0.75rem, 2vw, 1.75rem);
    position: fixed;
    inset: 0;
    z-index: 100000 !important;
    display: flex;
    align-items: flex-start !important;
    justify-content: center !important;
    padding: var(--attachment-overlay-top) var(--attachment-overlay-x) clamp(0.75rem, 2vh, 1.5rem) !important;
    background: rgba(15, 23, 42, 0.68);
    margin: 0 !important;
}

.attachment-overlay.hidden {
    display: none !important;
}

.attachment-overlay-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8fafc;
}

.attachment-overlay.is-overlay .attachment-overlay-card {
    width: min(92vw, 62rem) !important;
    max-width: calc(100vw - (var(--attachment-overlay-x) * 2)) !important;
    height: min(82vh, calc(100vh - var(--attachment-overlay-top) - 1.5rem)) !important;
    height: min(82dvh, calc(100dvh - var(--attachment-overlay-top) - 1.5rem)) !important;
    max-height: calc(100vh - var(--attachment-overlay-top) - 1.5rem) !important;
    max-height: calc(100dvh - var(--attachment-overlay-top) - 1.5rem) !important;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    border: 1px solid #dbe5d3;
    border-radius: 1rem;
    background: #f8fafc;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
}

.attachment-overlay-floating-close {
    display: none;
}

.attachment-overlay.is-overlay .attachment-overlay-floating-close {
    position: absolute;
    top: 0.9rem;
    right: 1rem;
    z-index: 100002;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    padding: 0.65rem 1rem;
    border: 0;
    border-radius: 0.85rem;
    background: #ffffff;
    color: #0f172a;
    font-weight: 900;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.26);
    cursor: pointer;
}

.attachment-overlay-head {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 3;
    min-height: 3.4rem;
}

.attachment-overlay .pdf-image-preview {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(72vh, 42rem) !important;
    overflow: auto !important;
    overscroll-behavior: contain;
}

.attachment-overlay.is-overlay .pdf-image-preview {
    max-height: none !important;
}

.attachment-overlay .pdf-preview-page {
    width: min(100%, 760px) !important;
    max-width: 100% !important;
    height: auto !important;
}

.attachment-overlay img:not(.pdf-preview-page) {
    flex: 1 1 auto;
    width: 100%;
    max-height: min(72vh, 42rem);
    min-height: 0;
    object-fit: contain;
}

body.attachment-overlay-open {
    overflow: hidden;
}

.attachment-overlay-open .app-sidebar,
.attachment-overlay-open .app-footer {
    pointer-events: none;
}

body.attachment-overlay-open .request-view-card > .flex.justify-between .mobile-stack {
    opacity: 0;
    pointer-events: none;
}

.attachment-overlay.is-overlay .attachment-overlay-floating-close {
    display: none !important;
}

/* Mobile header readability fix */
@media (max-width: 768px) {
    .app-content > .bg-white:first-child {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center !important;
        gap: 0.75rem !important;
        padding-left: 4.25rem !important;
        padding-right: 0.85rem !important;
    }

    .app-content > .bg-white:first-child h1 {
        min-width: 0;
        max-width: 100%;
        white-space: normal;
        word-break: normal !important;
        overflow-wrap: normal !important;
        hyphens: none;
        font-size: 1.18rem !important;
        line-height: 1.2 !important;
    }

    .app-content > .bg-white:first-child > div:not(.mobile-overlay),
    .app-content > .bg-white:first-child > a,
    .app-content > .bg-white:first-child > button {
        min-width: 0;
    }

    .app-content > .bg-white:first-child > div {
        font-size: 0.9rem;
        line-height: 1.3;
    }

    .app-content > .bg-white:first-child > a.bg-red-500,
    .app-content > .bg-white:first-child > a.bg-gray-600,
    .app-content > .bg-white:first-child > a.bg-blue-600 {
        justify-self: end;
        min-height: 2.6rem;
        padding: 0.65rem 0.9rem !important;
        white-space: nowrap;
    }

    .app-content > .bg-white:first-child > div + a.bg-red-500 {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
    }

    .app-content > .bg-white:first-child h1 + div {
        grid-column: 1 / 2;
        grid-row: 2;
        color: #475569;
    }
}

@media (max-width: 430px) {
    .app-content > .bg-white:first-child {
        grid-template-columns: minmax(0, 1fr) auto;
        padding-left: 4rem !important;
    }

    .app-content > .bg-white:first-child h1 {
        font-size: 1.05rem !important;
    }

    .app-content > .bg-white:first-child > div {
        font-size: 0.82rem;
    }
}

/* Global navigation loader */
.app-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: rgba(238, 243, 240, 0.74);
    backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
}

.app-loader.show {
    opacity: 1;
    pointer-events: auto;
}

.app-loader-box {
    min-width: 10rem;
    display: grid;
    justify-items: center;
    gap: 0.85rem;
    padding: 1.35rem 1.6rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(169, 211, 47, 0.36);
    border-radius: 1rem;
    box-shadow: 0 24px 60px rgba(31, 41, 51, 0.18);
    color: #22252b;
    font-weight: 800;
}

.app-loader-spinner {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 999px;
    border: 4px solid #dfecc0;
    border-top-color: #82ad17;
    animation: app-loader-spin 0.8s linear infinite;
}

.app-loader-text {
    font-size: 0.9rem;
    letter-spacing: 0;
}

@keyframes app-loader-spin {
    to { transform: rotate(360deg); }
}

/* In-page delete warning modal */
.app-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(17, 24, 39, 0.42);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
}

.app-confirm-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.app-confirm-card {
    width: min(100%, 24rem);
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 1rem;
    background: #ffffff;
    border: 1px solid rgba(169, 211, 47, 0.32);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
    color: #172033;
}

.app-confirm-icon {
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #fff4c2;
    color: #a15c00;
    font-size: 1.25rem;
}

.app-confirm-body h2 {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    font-weight: 850;
    color: #172033;
}

.app-confirm-body p {
    margin: 0;
    color: #64748b;
    line-height: 1.45;
}

.app-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.app-confirm-actions button {
    min-height: 2.65rem;
    padding: 0.7rem 1rem;
    border: 0;
    border-radius: 0.75rem;
    cursor: pointer;
    font-weight: 800;
}

.app-confirm-cancel {
    background: #e5e7eb;
    color: #172033;
}

.app-confirm-delete {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff;
}

@media (max-width: 430px) {
    .app-confirm-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .app-confirm-actions button {
        width: 100%;
    }
}

/* Request mobile collision fixes */
@media (max-width: 768px) {
    .request-create-form label,
    .request-view-card label {
        display: block;
        margin-bottom: 0.45rem;
    }

    .request-create-form > div {
        position: relative;
        z-index: 1;
        margin-bottom: 1.05rem;
    }

    .request-create-form select,
    .request-create-form input,
    .request-create-form textarea {
        width: 100% !important;
        min-height: 3rem;
    }

    .request-create-form textarea {
        min-height: 7.5rem;
    }

    .request-view-card {
        padding: 1rem !important;
        overflow: visible;
    }

    .request-view-card > .flex.justify-between {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.85rem;
        align-items: stretch !important;
    }

    .request-view-card > .flex.justify-between h1 {
        font-size: 1.2rem !important;
        line-height: 1.25 !important;
        overflow-wrap: anywhere;
    }

    .request-view-card .detail-table {
        overflow: visible !important;
        box-shadow: none;
        background: transparent;
    }

    .request-view-card .detail-table table,
    .request-view-card .detail-table tbody,
    .request-view-card .detail-table tr,
    .request-view-card .detail-table td {
        display: block !important;
        width: 100% !important;
    }

    .request-view-card .detail-table table {
        border: 1px solid #dbe5d3;
        border-radius: 1rem;
        padding: 0.85rem;
        background: #fff;
    }

    .request-view-card .detail-table tr {
        padding: 0.55rem 0;
        border-bottom: 1px solid #edf4e4;
    }

    .request-view-card .detail-table tr:last-child {
        border-bottom: 0;
    }

    .request-view-card .detail-table td {
        padding: 0.1rem 0 !important;
        border: 0 !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }

    .request-view-card .detail-table td:first-child {
        color: #475569;
        font-weight: 800;
        font-size: 0.78rem;
    }

    .request-view-card .grid.grid-cols-2 {
        gap: 1.35rem !important;
    }

    .request-view-card .mt-10.border-t.pt-8 {
        margin-top: 1.5rem !important;
        padding-top: 1.25rem !important;
    }

    .request-view-card #statusForm {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 0.75rem !important;
        align-items: stretch !important;
    }

    .request-view-card #statusForm select,
    .request-view-card #statusForm input,
    .request-view-card #statusForm button {
        width: 100% !important;
        min-height: 3rem;
    }
}

@media (max-width: 430px) {
    .request-create-form {
        padding-bottom: 14.5rem !important;
    }

    .request-view-card .text-lg {
        font-size: 0.98rem !important;
        line-height: 1.45 !important;
    }
}

/* Keep mobile header rules away from form/detail cards */
@media (max-width: 768px) {
    .app-content.page-padding > .bg-white:first-child,
    .app-content.page-padding > .request-view-card:first-child {
        display: block !important;
        grid-template-columns: none !important;
        align-items: initial !important;
        gap: initial !important;
        min-height: auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-top: 1rem !important;
        position: relative !important;
    }

    .app-content.page-padding > .bg-white:first-child h1,
    .app-content.page-padding > .request-view-card:first-child h1 {
        font-size: 1.35rem !important;
        line-height: 1.25 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }

    .app-content.page-padding > .bg-white:first-child h1 + div,
    .app-content.page-padding > .request-view-card:first-child h1 + div {
        grid-column: auto !important;
        grid-row: auto !important;
    }

    .request-create-form {
        display: block !important;
        gap: 0 !important;
    }

    .request-create-form .request-submit-row {
        position: sticky;
        bottom: calc(2.25rem + env(safe-area-inset-bottom));
        z-index: 35;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.65rem !important;
        padding: 0.75rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom));
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        background: rgba(255, 255, 255, 0.94);
        border-top: 1px solid #e5efd9;
        box-shadow: 0 -18px 38px rgba(15, 23, 42, 0.12);
        backdrop-filter: blur(10px);
    }

    .request-create-form .request-submit-row button,
    .request-create-form .request-submit-row a {
        width: 100% !important;
        min-height: 3rem;
        padding: 0.8rem 1rem !important;
    }

    .request-view-card .mobile-stack,
    .request-view-card .mobile-stack > * {
        width: 100% !important;
    }

    .request-view-card .mobile-stack {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 0.7rem !important;
    }

    .request-view-card .mobile-stack a,
    .request-view-card .mobile-stack button,
    .request-view-card .mobile-stack span {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 430px) {
    .app-content.page-padding {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .app-content.page-padding > .bg-white:first-child,
    .app-content.page-padding > .request-view-card:first-child {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }
}

/* PDF image previews generated from uploads */
.pdf-image-preview {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    background: #6b7280;
    max-height: 78vh;
    overflow: auto;
}

.pdf-preview-page {
    display: block;
    width: min(100%, 980px);
    height: auto;
    margin: 0 auto;
    background: #fff;
    border-radius: 0.35rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
}

@media (max-width: 768px) {
    .pdf-image-preview {
        max-height: none;
        padding: 0.55rem;
        gap: 0.7rem;
    }

    .pdf-preview-page {
        width: 100%;
        border-radius: 0.25rem;
    }
}

@media (max-width: 768px) {
    .request-view-card .disabled-status-form {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 0.75rem !important;
        align-items: stretch !important;
    }

    .request-view-card .disabled-status-form select,
    .request-view-card .disabled-status-form button {
        width: 100% !important;
        min-height: 3rem;
    }
}

/* Received status proof upload */
.received-proof-upload {
    flex: 1 1 18rem;
    min-width: 18rem;
    padding: 0.9rem 1rem;
    border: 1px solid #dbe5d3;
    border-radius: 0.9rem;
    background: #f8fbf4;
}

.received-proof-upload input[type="file"] {
    cursor: pointer;
}

@media (max-width: 768px) {
    .received-proof-upload {
        width: 100%;
        min-width: 0;
        padding: 0.85rem;
    }
}

.status-inline-error {
    flex: 1 1 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #fecaca;
    border-radius: 0.85rem;
    background: #fef2f2;
    color: #991b1b;
    font-weight: 700;
}

.camera-capture {
    display: grid;
    gap: 0.75rem;
}

.camera-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.camera-actions-tight {
    padding: 0.65rem;
    background: #0f172a;
}

.camera-start-button,
.camera-fallback-button,
.camera-capture-button,
.camera-stop-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    border-radius: 0.75rem;
    padding: 0.7rem 1rem;
    border: 0;
    font-weight: 800;
    cursor: pointer;
}

.camera-start-button,
.camera-capture-button {
    background: #65a30d;
    color: #fff;
}

.camera-fallback-button {
    background: #e8f3d1;
    color: #365314;
}

.camera-stop-button {
    background: #334155;
    color: #fff;
}

.camera-panel {
    overflow: hidden;
    border: 1px solid #dbe5d3;
    border-radius: 0.9rem;
    background: #0f172a;
}

.camera-preview {
    display: block;
    width: 100%;
    max-height: 42vh;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #0f172a;
}

.camera-result {
    padding: 0.7rem 0.85rem;
    border-radius: 0.75rem;
    background: #ecfccb;
    color: #365314;
    font-weight: 800;
}

@media (max-width: 768px) {
    .camera-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .camera-start-button,
    .camera-fallback-button,
    .camera-capture-button,
    .camera-stop-button {
        width: 100%;
    }

    .camera-panel {
        max-height: 58vh;
        overflow: auto;
    }

    .camera-preview {
        max-height: 28vh;
    }
}

body.camera-overlay-open {
    overflow: hidden;
}

.camera-capture.is-open .camera-panel {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    border: 0;
    border-radius: 0;
    background: #050505;
}

.camera-capture.is-open .camera-preview {
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
    object-fit: contain;
    background: #050505;
}

.camera-capture.is-open .camera-actions-tight {
    display: grid;
    grid-template-columns: 4rem minmax(8rem, 16rem) 4rem;
    justify-content: center;
    align-items: center;
    gap: clamp(1rem, 6vw, 4rem);
    padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
    background: rgba(5, 5, 5, 0.74);
}

.camera-capture.is-open .camera-capture-button {
    min-height: 4rem;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 1.05rem;
    box-shadow: 0 1rem 2rem rgba(37, 99, 235, 0.28);
}

.camera-capture.is-open .camera-stop-button {
    width: 4rem;
    min-height: 4rem;
    border-radius: 999px;
    padding: 0;
    background: rgba(31, 41, 55, 0.82);
    color: #fff;
    font-size: 1.35rem;
}

.camera-result-error {
    background: #fee2e2;
    color: #991b1b;
}
@media (max-width: 768px) {
    .dashboard-stat-link {
        padding: 1rem !important;
    }

    .dashboard-stat-link p {
        font-size: 2rem !important;
    }

    .district-section > summary,
    .site-section > summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.45rem;
        padding: 0.9rem;
    }

    .site-section {
        margin: 0.75rem 0.6rem;
    }

    .dashboard-drilldown-table th {
        display: none;
    }

    .dashboard-drilldown-table tr {
        display: block;
        padding: 0.85rem;
        border-bottom: 1px solid #edf4e4;
    }

    .dashboard-drilldown-table td {
        display: grid;
        grid-template-columns: 7.5rem minmax(0, 1fr);
        gap: 0.7rem;
        text-align: left !important;
        padding: 0.25rem 0 !important;
        overflow-wrap: anywhere;
    }

    .dashboard-drilldown-table td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 0.76rem;
        font-weight: 900;
        text-transform: uppercase;
    }

    .status-stamp-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .status-timeline-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.55rem;
    }

    .status-timeline-current {
        width: fit-content;
    }

    .request-status-timeline {
        padding: 0.9rem;
    }

    .request-detail-panel {
        grid-template-columns: minmax(0, 1fr);
        padding: 0.75rem;
        gap: 0.65rem;
    }

    .request-detail-row {
        padding: 0.7rem 0.75rem;
    }
}

/* iPhone/mobile request view safe-area fixes */
@media (max-width: 768px) {
    .request-view-card {
        padding-bottom: calc(7.5rem + env(safe-area-inset-bottom)) !important;
    }

    .request-view-card .mt-10.border-t.pt-8:last-of-type {
        margin-bottom: calc(4.5rem + env(safe-area-inset-bottom)) !important;
    }

    .request-view-card #statusForm {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    .request-view-card #statusForm > button {
        position: sticky;
        bottom: calc(3.25rem + env(safe-area-inset-bottom));
        z-index: 38;
        min-height: 3.2rem;
        border-radius: 0.9rem !important;
        box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.18);
    }

    .request-view-card .attachment-viewer {
        margin-bottom: 1rem;
    }

    .request-view-card .pdf-image-preview {
        max-height: 62vh;
        max-height: 62dvh;
    }

    .users-search-form,
    .users-search-actions,
    .user-create-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .users-district-section > summary,
    .users-site-section > summary,
    .user-card-head,
    .user-create-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .users-site-section {
        margin: 0.75rem 0.6rem;
    }

    .users-card-grid {
        grid-template-columns: minmax(0, 1fr);
        padding: 0.75rem;
    }

    .user-create-modal {
        align-items: start;
        padding: 4.5rem 0.75rem calc(1.25rem + env(safe-area-inset-bottom));
    }

    .user-create-card {
        padding: 1rem;
    }

    .user-create-close,
    .user-create-actions button {
        width: 100%;
    }

    .attachment-overlay.is-overlay {
        padding: 3.7rem 0.5rem 0.5rem;
        align-items: stretch;
    }

    .attachment-overlay.is-overlay .attachment-overlay-card {
        width: 100%;
        height: calc(100vh - 4.2rem);
        height: calc(100dvh - 4.2rem);
        max-height: calc(100vh - 4.2rem) !important;
        max-height: calc(100dvh - 4.2rem) !important;
        border-radius: 0.85rem;
    }

    .attachment-overlay.is-overlay .attachment-overlay-floating-close {
        top: 0.55rem;
        right: 0.55rem;
        left: 0.55rem;
        width: auto;
    }

    .attachment-overlay .pdf-image-preview {
        padding: 0.55rem;
        max-height: none !important;
    }

    .attachment-overlay img:not(.pdf-preview-page) {
        max-height: calc(100vh - 7rem);
        max-height: calc(100dvh - 7rem);
    }
}

/* Reports filter buttons need their own mobile grid so export labels never collapse. */
@media (max-width: 768px) {
    .report-filter-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.65rem !important;
        align-items: stretch !important;
        justify-content: stretch !important;
        width: 100% !important;
    }

    .report-filter-actions > .report-action-btn {
        display: inline-flex !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 2.85rem !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.45rem !important;
        padding: 0.75rem 0.65rem !important;
        white-space: nowrap !important;
        line-height: 1.1 !important;
        text-align: center !important;
        flex: none !important;
    }

    .report-filter-actions > .report-action-btn i {
        flex: 0 0 auto !important;
    }
}

@media (max-width: 340px) {
    .report-filter-actions {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

.app-refresh-button {
    position: fixed;
    left: calc(16rem + 1rem);
    right: auto;
    bottom: calc(0.65rem + env(safe-area-inset-bottom));
    z-index: 45;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.65rem;
    padding: 0.7rem 1rem;
    border: 0;
    border-radius: 999px;
    background: #344256;
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    line-height: 1;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.22);
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.app-refresh-button:hover {
    background: #111827;
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.28);
}

.app-refresh-button:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .app-refresh-button {
        left: 0.85rem;
        right: auto;
        bottom: calc(3.65rem + env(safe-area-inset-bottom));
        width: 2.9rem;
        min-height: 2.9rem;
        padding: 0;
        border-radius: 50%;
    }

    .app-refresh-button span {
        display: none;
    }
}

/* Light MEPG navigation theme */
.app-sidebar,
.app-sidebar.bg-gray-900 {
    background: linear-gradient(180deg, #fbfdf6 0%, #eef7db 58%, #f8fbf1 100%) !important;
    border-right: 1px solid rgba(169, 211, 47, 0.34) !important;
    color: #24320f !important;
    box-shadow: 8px 0 26px rgba(91, 118, 25, 0.12) !important;
}

.app-sidebar > .p-6 {
    color: #24320f !important;
    border-bottom-color: rgba(169, 211, 47, 0.34) !important;
}

.app-sidebar nav a {
    color: #344054 !important;
}

.app-sidebar nav a i {
    width: 2rem !important;
    height: 2rem;
    display: inline-grid;
    place-items: center;
    flex: 0 0 2rem;
    margin-right: 0.75rem !important;
    border-radius: 0.7rem;
    background: rgba(169, 211, 47, 0.18);
    color: #6f9e16 !important;
    font-size: 0.98rem;
    box-shadow: inset 0 0 0 1px rgba(169, 211, 47, 0.22);
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.app-sidebar nav a:hover {
    background: rgba(169, 211, 47, 0.18) !important;
    color: #172033 !important;
}

.app-sidebar nav a.bg-gray-800,
.app-sidebar nav a.bg-gray-800:hover {
    background: linear-gradient(135deg, #a9d32f 0%, #82ad17 100%) !important;
    color: #172033 !important;
    box-shadow: 0 14px 30px rgba(130, 173, 23, 0.22) !important;
}

.app-sidebar nav a.bg-gray-800 i {
    background: rgba(255, 255, 255, 0.28);
    color: #172033 !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.36);
}

.app-sidebar nav a:hover i {
    transform: translateX(1px);
    background: rgba(169, 211, 47, 0.26);
}

.mobile-menu-button.bg-gray-900 {
    background: #f8fbf1 !important;
    border-color: rgba(169, 211, 47, 0.5) !important;
    color: #24320f !important;
}

@media (min-width: 769px) {
    .resizable-table {
        table-layout: fixed;
    }

    .resizable-table th {
        position: relative;
        user-select: none;
    }

    .resizable-table th .column-resize-handle {
        position: absolute;
        top: 0;
        right: -0.25rem;
        bottom: 0;
        z-index: 3;
        width: 0.5rem;
        cursor: col-resize;
        touch-action: none;
    }

    .resizable-table th .column-resize-handle::after {
        content: "";
        position: absolute;
        top: 22%;
        right: 0.18rem;
        width: 2px;
        height: 56%;
        border-radius: 999px;
        background: rgba(111, 158, 22, 0.22);
        transition: background-color 140ms ease, box-shadow 140ms ease;
    }

    .resizable-table th:hover .column-resize-handle::after,
    .resizable-table.is-resizing .column-resize-handle.is-active::after {
        background: #6f9e16;
        box-shadow: 0 0 0 3px rgba(169, 211, 47, 0.18);
    }

    body.table-column-resizing {
        cursor: col-resize !important;
        user-select: none;
    }
}
