/* Inventizy — phone & installed-app layer. Loaded after inventizy.css. */

/* Notches / rounded corners when installed (viewport-fit=cover) */
.iz-tb { padding-left: max(var(--iz-gutter), env(safe-area-inset-left)); padding-right: max(var(--iz-gutter), env(safe-area-inset-right)); }
html.iz-standalone .iz-tb { height: calc(var(--iz-bar-h) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
html.iz-standalone .iz-sb-logo { height: calc(var(--iz-bar-h) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
.iz-sb-foot { padding-bottom: max(10px, env(safe-area-inset-bottom)); }

/* Installed app: no accidental text selection on chrome, no pull-to-refresh bounce on the shell */
html.iz-standalone .iz-tb, html.iz-standalone .iz-sb, html.iz-standalone .iz-tabs { -webkit-user-select: none; user-select: none; }
html.iz-standalone body { overscroll-behavior: none; }
.iz-main { overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }

/* Each table scrolls sideways inside its own box (wrapped by inventizy.js) */
.iz-table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Bottom tab bar (phones) */
.iz-tabs { display: none; }
@media (max-width: 767.98px) {
    :root { --iz-tabs-h: 60px; --iz-bar-h: 52px; --iz-gutter: 12px; }
    .iz-tabs {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
        display: flex; align-items: stretch;
        height: calc(var(--iz-tabs-h) + env(safe-area-inset-bottom));
        padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
        background: var(--iz-surface); border-top: 1px solid var(--iz-border);
        box-shadow: 0 -6px 18px rgba(15, 23, 42, .06);
    }
    .iz-tab {
        flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        border: 0; background: none; color: var(--iz-muted); font: 600 10.5px/1.1 var(--iz-font); text-decoration: none;
        -webkit-tap-highlight-color: transparent; position: relative;
    }
    .iz-tab i { font-size: 18px; }
    .iz-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
    .iz-tab.is-active { color: var(--iz-primary); }
    .iz-tab.is-active::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 4px 4px; background: var(--iz-primary); }
    .iz-main { padding-bottom: calc(var(--iz-tabs-h) + env(safe-area-inset-bottom)); }
    .iz-ai { top: auto; bottom: calc(var(--iz-tabs-h) + env(safe-area-inset-bottom) + 8px); max-height: calc(100dvh - var(--iz-bar-h) - var(--iz-tabs-h) - 32px); }

    .iz-tb { gap: 6px; }
    .iz-tb-btn { height: 34px; min-width: 34px; }
    .iz-footer { display: none; }
    .card > .card-header { min-height: 0; padding-top: 10px; padding-bottom: 10px; }
    .card-header .card-title, .iz-card-actions { width: 100%; }
    .iz-card-actions { margin-left: 0; }
    .modal-dialog { margin: .5rem; }
    .modal-fullscreen-sm-down .modal-content { border-radius: 0; }
    div.dataTables_wrapper div.dataTables_length, div.dataTables_wrapper div.dataTables_filter,
    div.dataTables_wrapper div.dataTables_info, div.dataTables_wrapper div.dataTables_paginate { text-align: left; }
    div.dataTables_wrapper .dataTables_paginate .pagination { justify-content: flex-start; }
    .swal2-popup { width: calc(100vw - 24px) !important; }
}

/* Larger touch targets on touch devices */
@media (pointer: coarse) {
    .iz-sb-item { min-height: 40px; }
    .iz-sb-subitem { min-height: 34px; }
    .btn-sm { min-height: 34px; }
    .iz-sb-pin { opacity: 1; }
}
