
/* FIRECOM WAREHOUSEPORTAL — MOBIEL */

html {
    -webkit-text-size-adjust: 100%;
}

body {
    min-width: 0;
}

img, svg, video {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {

    /* Algemene inhoud */
    main,
    .content,
    .page-content,
    .main-content {
        min-width: 0;
        max-width: 100%;
    }

    .content,
    .page-content,
    .main-content {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Kaarten */
    .panel,
    .card,
    .fc-order-header-card,
    .fc-alert-panel {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box;
        border-radius: 12px !important;
    }

    .fc-order-header-card {
        padding: 16px !important;
    }

    /* Ordertitel en status */
    .fc-order-heading,
    .fc-order-title-row {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .fc-order-heading {
        font-size: 21px !important;
    }

    .fc-inline-status,
    .status-pill {
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }

    /* Kaarten met orderinformatie */
    .dashboard-grid,
    .orders-grid,
    .detail-grid,
    .stats-grid,
    .summary-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    /* Tabellen: horizontaal scrollen in plaats van afsnijden */
    .table-wrap,
    .table-responsive,
    .table-container {
        overflow-x: auto !important;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }

    table {
        max-width: none;
    }

    th, td {
        white-space: nowrap;
    }

    /* Formulieren */
    input,
    select,
    textarea {
        max-width: 100%;
        box-sizing: border-box;
        font-size: 16px;
    }

    button,
    .btn,
    input[type="submit"] {
        min-height: 42px;
    }

    /* Urenregistratie */
    .fc-hours {
        width: 100%;
        max-width: 100%;
    }

    .fc-heading {
        padding: 18px;
    }

    .fc-activity-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .fc-activity-button {
        min-height: 68px;
        padding: 15px;
    }

    .fc-activity-detail {
        padding: 15px;
    }

    .fc-time-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fc-order-list {
        grid-template-columns: minmax(0, 1fr);
        max-height: 300px;
    }

    .fc-order-option {
        min-height: 52px;
    }

    .fc-summary {
        bottom: 8px;
        padding: 14px;
    }

    /* Lange teksten */
    .fc-alert-description,
    .fc-alert-message,
    .page-subtitle {
        overflow-wrap: anywhere;
        white-space: normal;
    }
}

@media (max-width: 390px) {
    .fc-stepper button {
        width: 34px;
        min-width: 34px;
    }

    .fc-stepper input {
        min-width: 0;
        width: 100%;
        font-size: 18px;
    }

    .fc-order-header-card {
        padding: 13px !important;
    }
}



/* =====================================================
   FIRECOM MOBILE NAVIGATION V2
   ===================================================== */

.fc-mobile-bar {
    display: none;
}

.fc-menu-backdrop[hidden] {
    display: none !important;
}

@media (max-width: 850px) {

    html, body {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }

    .app-shell {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
    }

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

    /* Sidebar standaard buiten beeld */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: min(290px, 84vw) !important;
        max-width: 84vw !important;
        height: 100dvh !important;
        z-index: 1201 !important;
        transform: translateX(-105%) !important;
        transition: transform .22s ease !important;
        overflow-y: auto !important;
        visibility: hidden;
    }

    body.fc-menu-open .sidebar {
        transform: translateX(0) !important;
        visibility: visible;
    }

    body.fc-menu-open {
        overflow: hidden;
    }

    /* Herstel volledige navigatieteksten */
    .sidebar .brand-text,
    .sidebar .nav-label,
    .sidebar .nav-item {
        font-size: revert !important;
    }

    .sidebar .brand-text {
        display: flex !important;
        flex-direction: column !important;
    }

    .sidebar .nav-label {
        font-size: 11px !important;
    }

    .sidebar .nav-item {
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 12px !important;
        font-size: 14px !important;
        min-height: 46px;
        white-space: normal;
    }

    .sidebar .nav-icon {
        flex: 0 0 26px;
        font-size: 19px !important;
    }

    .sidebar .sidebar-brand {
        padding: 0 20px !important;
    }

    .fc-menu-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(12, 16, 30, .6);
        z-index: 1200;
    }

    /* Header krijgt een eigen mobiele indeling */
    .topbar {
        height: auto !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .fc-mobile-bar {
        display: flex !important;
        align-items: center;
        gap: 12px;
        min-height: 60px;
        padding: 10px 16px;
        background: #191629;
        color: #fff;
        width: 100%;
    }

    .fc-mobile-menu-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        border: 1px solid rgba(255,255,255,.25);
        border-radius: 10px;
        background: transparent;
        color: #fff;
        font-size: 25px;
        cursor: pointer;
    }

    .fc-mobile-brand {
        display: flex;
        align-items: center;
        gap: 9px;
        font-size: 17px;
        font-weight: 850;
        letter-spacing: .03em;
        white-space: nowrap;
    }

    .fc-mobile-brand-mark {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 25px;
        height: 32px;
        border-radius: 7px;
        background: #ffb000;
        color: #191629;
        font-weight: 900;
    }

    .fc-mobile-account {
        margin-left: auto;
        min-width: 0;
        max-width: 34%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px;
        color: #e9e5f0;
    }

    /* Paginatitel onder de mobiele balk */
    .topbar > div:not(.fc-mobile-bar) {
        width: 100%;
        min-width: 0;
        padding: 15px 16px 8px;
    }

    .topbar .page-title {
        font-size: clamp(22px, 6vw, 29px) !important;
        line-height: 1.2 !important;
        margin: 0 0 5px !important;
        overflow-wrap: anywhere;
    }

    .topbar .page-subtitle {
        font-size: 13px !important;
        line-height: 1.5 !important;
        white-space: normal !important;
    }

    /* Accountgegevens en uitloggen via nette tweede regel */
    .topbar .topbar-right {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        padding: 8px 16px 14px !important;
        width: 100%;
        min-width: 0;
    }

    .topbar .user-info {
        min-width: 0;
        flex: 1 1 auto;
    }

    .topbar .user-info strong {
        display: none;
    }

    .topbar .user-info span {
        font-size: 12px;
    }

    .topbar .logout-form {
        flex: 0 0 auto;
    }

    .topbar .logout-form button {
        min-height: 38px;
        padding: 8px 13px;
        font-size: 13px;
    }

    .page-content {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 14px 12px 24px !important;
    }

    /* Kaarten en dashboard */
    .flow-grid,
    .order-summary-grid,
    .order-kpi-grid,
    .management-corrections-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .summary-card,
    .panel,
    .flow-card {
        min-width: 0;
        max-width: 100%;
    }

    .dashboard-toolbar,
    .dashboard-toolbar-actions,
    .date-picker-form {
        width: 100%;
        min-width: 0;
    }

    .dashboard-toolbar-actions > *,
    .dashboard-toolbar-actions > form,
    .date-picker-form > * {
        max-width: 100%;
    }

    .dashboard-toolbar .btn,
    .dashboard-toolbar button {
        white-space: normal;
    }

    /* Brede tabellen blijven binnen de pagina scrollbaar */
    .table-wrapper,
    .table-wrap,
    .table-responsive {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Orders als mobiele kaarten */
    .fc-orders-desktop {
        display: none !important;
    }

    .fc-orders-mobile {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .fc-order-mobile-card {
        display: block;
        padding: 16px;
        border: 1px solid #dfe3e8;
        border-top: 3px solid #ffb000;
        border-radius: 12px;
        background: #fff;
        color: #191629;
        text-decoration: none;
    }

    .fc-order-mobile-card strong {
        display: block;
        font-size: 17px;
    }

    .fc-order-mobile-card .fc-order-customer {
        display: block;
        margin: 7px 0;
        color: #64748b;
        font-size: 13px;
        overflow-wrap: anywhere;
    }

    .fc-order-mobile-card .fc-order-status {
        display: inline-block;
        padding: 5px 9px;
        border-radius: 999px;
        background: #eef2f6;
        font-size: 11px;
        font-weight: 750;
    }

    .fc-order-mobile-card .fc-order-amounts {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px;
        margin-top: 14px;
        padding-top: 12px;
        border-top: 1px solid #edf0f2;
        font-size: 12px;
    }

    .fc-order-mobile-card .fc-order-amounts span {
        color: #64748b;
    }

    .fc-order-mobile-card .fc-order-amounts b {
        text-align: right;
    }
}

@media (min-width: 851px) {
    .fc-orders-mobile {
        display: none !important;
    }

    .fc-orders-desktop {
        display: block;
    }
}


/* FIRECOM OFFICIEEL LOGO */

/* Desktop sidebar */
.sidebar-brand .fc-brand-logo {
    display: block;
    width: 100%;
    max-width: 195px;
    height: auto;
    object-fit: contain;
}

/* Mobiele header */
.fc-mobile-brand .fc-mobile-logo {
    display: block;
    width: 155px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

@media (max-width: 850px) {
    .sidebar-brand .fc-brand-logo {
        max-width: 205px;
    }

    .fc-mobile-brand {
        min-width: 0;
        flex: 0 1 auto;
    }

    .fc-mobile-brand .fc-mobile-logo {
        width: clamp(105px, 32vw, 155px);
    }
}

@media (max-width: 390px) {
    .fc-mobile-brand .fc-mobile-logo {
        width: 115px;
    }
}
