﻿/* Shared mobile styles. The dashboard and account pages have their own layouts. */
@media (max-width: 767px) {
    .mobile-navigation-pending::after {
        content: "";
        position: fixed;
        inset: 0 0 auto;
        height: 4px;
        z-index: 2000;
        pointer-events: none;
        background: linear-gradient(90deg, #23569c, #86c4ff, #23569c);
        background-size: 200% 100%;
        animation: mobile-navigation-progress .9s linear infinite;
    }

    @keyframes mobile-navigation-progress {
        to { background-position: 200% 0; }
    }

    @media (prefers-reduced-motion: reduce) {
        .mobile-navigation-pending::after { animation: none; }
    }

    .app-content .mobile-page {
        --page-dark: #102653;
        --page-accent: #2356a0;
        --page-light: #e8f0ff;
        --page-border: #d2e1f7;
        --heading-tint: #deedff;
        --heading-pattern: repeating-radial-gradient(circle at 4% 96%, transparent 0 13px, rgb(102 154 216 / 18%) 14px 15px, transparent 16px 25px);
        min-width: 0;
        padding: 14px clamp(12px, 4vw, 22px) 25px;
        background: linear-gradient(180deg, #edf5ff, #f6f8fc 380px);
    }

    .app-content .theme-indigo {
        --page-dark: #272651;
        --page-accent: #5643a0;
        --page-light: #eee9fb;
        --page-border: #e2d8f7;
        --heading-tint: #e5ecff;
        --heading-pattern: radial-gradient(ellipse at 4% 115%, transparent 55%, rgb(113 133 208 / 19%) 55.5% 56%, transparent 57% 65%, rgb(113 133 208 / 14%) 65.5% 66%, transparent 67%);
    }

    .app-content .theme-teal {
        --page-dark: #113b42;
        --page-accent: #176960;
        --page-light: #e3f3ed;
        --page-border: #cce5da;
        --heading-tint: #deeff9;
        --heading-pattern: repeating-linear-gradient(-38deg, transparent 0 12px, rgb(72 151 177 / 16%) 13px 14px, transparent 15px 24px);
    }

    .app-content .theme-amber {
        --page-dark: #482d1a;
        --page-accent: #86501f;
        --page-light: #fff1df;
        --page-border: #f1dec4;
        --heading-tint: #e6effc;
        --heading-pattern: radial-gradient(circle, rgb(153 112 60 / 22%) 1px, transparent 1.6px);
    }

    .app-content :is(.warehouses-page, .inventory-page) {
        --heading-pattern: linear-gradient(45deg, transparent 45%, rgb(84 144 203 / 19%) 46% 50%, transparent 51%),
            linear-gradient(-45deg, transparent 45%, rgb(84 144 203 / 14%) 46% 50%, transparent 51%);
    }

    .app-content :is(.equipment-create-page, .equipment-edit-page, .image-request-page) {
        --heading-pattern: radial-gradient(ellipse at 5% 0, transparent 36%, rgb(99 142 208 / 19%) 37% 38%, transparent 39% 54%, rgb(99 142 208 / 16%) 55% 56%, transparent 57%);
    }

    .mobile-page :is(.warehouses-header, .inventory-header) {
        --heading-pattern-size: 23px 23px;
    }

    .theme-amber .mobile-heading {
        --heading-pattern-size: 12px 12px;
    }

    .mobile-page .breadcrumb {
        row-gap: 4px;
        flex-wrap: wrap;
        margin-bottom: 10px;
    }

    .mobile-page .mobile-heading {
        min-width: 0;
        gap: 12px;
        padding: 18px 14px;
        margin-bottom: 15px;
        border: 1px solid #cfdef3;
        border-radius: 21px;
        background:
            linear-gradient(to left, #f8fbff 20%, rgb(239 247 255 / 94%) 60%, transparent 100%),
            var(--heading-pattern),
            linear-gradient(145deg, #f5faff, var(--heading-tint));
        background-size: auto, var(--heading-pattern-size, auto), auto, auto;
        color: #183353;
        box-shadow: 0 6px 18px rgb(35 86 156 / 8%);
    }

    .mobile-page :is(.warehouses-header, .inventory-header) {
        background-size: auto, var(--heading-pattern-size), var(--heading-pattern-size), auto;
    }

    .mobile-page .mobile-heading :is(h1, h2) {
        margin: 0;
        color: #183353;
        font-size: clamp(17px, 5vw, 22px);
        line-height: 1.65;
        overflow-wrap: anywhere;
    }

    .mobile-page .mobile-heading p,
    .mobile-page .mobile-heading :is(.header-caption, .category-caption, .warehouse-code, .equipment-code),
    .mobile-page .mobile-heading > div > span:first-child {
        color: #435d7a;
        font-size: 11px;
        line-height: 1.8;
    }

    .mobile-page .mobile-heading :is(.header-content, .warehouse-heading, .profile-main, .header-title) {
        gap: 10px;
        min-width: 0;
    }

    .mobile-page .mobile-heading :is(.header-icon, .warehouse-symbol, .back-button) {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        border: 1px solid #c9dcf4;
        border-radius: 13px;
        background: rgb(255 255 255 / 88%);
        color: var(--page-accent);
    }

    .mobile-page .mobile-heading :is(.header-icon, .warehouse-symbol) svg {
        width: 26px;
        height: 26px;
    }

    .mobile-page .mobile-heading .secondary-button {
        background: #fff;
        color: var(--page-dark);
    }

    .mobile-page .mobile-heading .profile-image {
        width: 72px;
        height: 78px;
        padding: 6px;
        border-color: #c9dcf4;
        background: #f8fbff;
    }

    .mobile-page .request-header {
        flex-wrap: wrap;
    }

    .mobile-page :is(.statistics-grid, .summary-grid, .image-stats) {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 22px;
    }

    .mobile-page :is(.statistics-grid, .summary-grid):has(> .mobile-stat:nth-child(4):last-child) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mobile-page .mobile-stat {
        --card-ink: #1c5094;
        --card-fill: #e8f1ff;
        --card-edge: #cfe0f9;
        min-width: 0;
        min-height: 87px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: flex-start;
        gap: 5px;
        padding: 10px 8px;
        border: 1px solid var(--card-edge);
        border-radius: 14px;
        background: linear-gradient(150deg, #fff, var(--card-fill) 74%);
        box-shadow: 0 3px 10px rgb(25 55 93 / 5%);
    }

    .mobile-page .tone-purple { --card-ink: #624095; --card-fill: #f0e9fb; --card-edge: #e3d7f5; }
    .mobile-page .tone-green { --card-ink: #166247; --card-fill: #e4f4ec; --card-edge: #cce8d8; }
    .mobile-page .tone-amber { --card-ink: #83490c; --card-fill: #fff0da; --card-edge: #f2dcba; }
    .mobile-page .tone-red { --card-ink: #982b44; --card-fill: #fce9ee; --card-edge: #f1d4df; }
    .mobile-page .tone-teal { --card-ink: #115b70; --card-fill: #e2f4f7; --card-edge: #cce7ed; }

    .mobile-page .mobile-stat strong {
        margin-top: 0;
        color: var(--card-ink);
        font-size: clamp(18px, 4.8vw, 24px);
        line-height: 1.45;
        overflow-wrap: anywhere;
    }

    .mobile-page .summary-card strong {
        font-size: clamp(13px, 3.8vw, 17px);
    }

    .mobile-page .mobile-stat span {
        color: #31425b;
        line-height: 1.55;
        overflow-wrap: anywhere;
    }

    .mobile-page .mobile-stat small {
        color: #495975;
    }

    .mobile-page .mobile-stat .unknown-quantity-caption {
        color: #874400;
    }

    .mobile-page .mobile-stat .stat-icon {
        width: 27px;
        height: 27px;
        border-radius: 8px;
        color: var(--card-ink);
        background: rgb(255 255 255 / 75%);
    }

    .mobile-page .mobile-stat .stat-icon svg {
        width: 16px;
        height: 16px;
    }

    .mobile-page .filter-panel {
        gap: 8px;
        padding: 10px;
        margin-bottom: 25px;
        border: 1px solid var(--page-border);
        border-radius: 17px;
        background: linear-gradient(145deg, #fff, #eff6ff);
        box-shadow: 0 4px 14px rgb(35 86 156 / 6%);
    }

    .mobile-page .filter-panel :is(.search-field, select, input) {
        min-width: 0;
        min-height: 44px;
        font-size: 13px;
    }

    .mobile-page .filter-panel :is(.search-field, select) {
        background: #fff;
    }

    .mobile-page .filter-panel .search-field:focus-within {
        outline: 2px solid var(--page-accent);
        outline-offset: 2px;
    }

    .mobile-page :is(.list-heading, .section-heading) {
        gap: 8px;
        flex-wrap: wrap;
        margin-bottom: 12px;
    }

    .mobile-page :is(.list-heading, .section-heading) > :is(div, h2) {
        min-width: 0;
    }

    .mobile-page :is(.list-heading, .section-heading) h2 {
        padding-inline-start: 8px;
        border-inline-start: 4px solid var(--page-accent);
        color: var(--color-text);
        font-size: clamp(14px, 4.2vw, 17px);
        line-height: 1.6;
    }

    .mobile-page :is(.heading-actions, .list-actions, .request-footer, .form-actions, .modal-footer) {
        flex-wrap: wrap;
        gap: 8px;
    }

    .mobile-page :is(.primary-button, .secondary-button, .action-button, .tab-button) {
        min-height: 44px;
    }

    .mobile-page .list-actions {
        justify-content: flex-start;
    }

    .mobile-page :is(.warehouse-card, .equipment-card, .request-card, .record-card, .timeline-card) {
        border: 1px solid #dde6ef;
        border-inline-start: 4px solid var(--page-border);
        border-radius: 17px;
        background: #fff;
        box-shadow: 0 4px 14px rgb(35 86 156 / 6%);
    }

    .mobile-page :is(.warehouse-card, .equipment-card, .request-card, .record-card, .timeline-card)
        :is(.warehouse-icon, .equipment-image, .record-icon, .request-icon) {
        border-radius: 12px;
    }

    .mobile-page :is(.equipment-details, .equipment-information, .request-details, .request-info, .record-information) {
        padding: 10px 8px;
        border: 0;
        border-radius: 11px;
        background: #f2f6fb;
    }

    .mobile-page :is(.equipment-details, .equipment-information, .request-details, .record-information) strong {
        overflow-wrap: anywhere;
    }

    .mobile-page :is(.request-card, .record-card, .equipment-card, .warehouse-card) h3 {
        line-height: 1.7;
        overflow-wrap: anywhere;
    }

    .mobile-page :is(.form-card, .information-card, .description-card) {
        padding: 14px;
        border: 1px solid #dde6ef;
        border-block-start: 3px solid var(--page-border);
        border-radius: 16px;
        background: #fff;
        box-shadow: none;
    }

    .mobile-page :is(.mobile-form-technical, .information-grid > :nth-child(2), .guidelines-panel) {
        --page-accent: #65449c;
        --page-border: #ddcef1;
        background: #faf7fe;
    }

    .mobile-page :is(.mobile-form-reason, .description-card) {
        --page-accent: #8b541b;
        --page-border: #f1d8b6;
        background: #fffbf4;
    }

    .mobile-page :is(.form-field, .field-group, .manager-comment) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea) {
        min-width: 0;
        min-height: 44px;
        font-size: 16px;
        background-color: #fff;
    }

    .mobile-page .profile-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
        padding: 5px;
        border-color: var(--page-border);
        background: var(--page-light);
    }

    .mobile-page .profile-tabs .tab-button {
        min-width: 0;
        padding: 7px 4px;
        line-height: 1.55;
        white-space: normal;
    }

    .mobile-page :is(.profile-tabs .tab-button.active, .history-tabs .active) {
        background: #fff;
        color: var(--page-accent);
    }

    .mobile-page :is(.description-card, .technical-item, .empty-state) {
        overflow-wrap: anywhere;
    }

    .mobile-page .technical-item {
        border-color: #e4daf5;
        background: #faf7fe;
    }

    .mobile-page :is(.reason-box, .manager-box, .approval-notice, .manager-comment) {
        border-radius: 13px;
    }

    .mobile-page :is(.change-values, .field-values) :is(.old-value, .new-value) {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .mobile-page .modal-overlay {
        align-items: flex-end;
        padding: 8px 8px max(8px, env(safe-area-inset-bottom, 0px));
    }

    .mobile-page .modal-overlay :is(.modal-panel, .details-modal, .preview-modal, .review-modal) {
        width: 100%;
        max-height: calc(100dvh - 16px - env(safe-area-inset-bottom, 0px));
        border-radius: 21px 21px 14px 14px;
    }

    .mobile-page .modal-overlay .modal-body {
        min-height: 0;
        overscroll-behavior: contain;
    }

    .mobile-page .modal-overlay .modal-header {
        background: var(--page-light);
    }

    .mobile-page .empty-state {
        margin-top: 10px;
        padding: 23px 13px;
        border: 1px solid var(--page-border);
        border-radius: 17px;
        background: var(--page-light);
        text-align: center;
    }

    .mobile-page .empty-state p {
        margin-top: 5px;
        color: var(--color-text-secondary);
    }

    .mobile-page .mobile-return-link {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        margin-top: 12px;
        padding-inline: 12px;
        border-radius: 10px;
        background: #fff;
        color: var(--page-accent);
        font-weight: 700;
    }
}
