﻿    /* ----- RESPONSIVE ----- */
    @media (max-width: 960px) {
      #header {
        height: auto;
        padding: 12px 16px;
        align-items: stretch;
        flex-wrap: wrap;
        gap: 10px;
      }

      #header > div:first-child,
      #header > div:last-child {
        width: 100%;
      }

      #header > div:first-child {
        flex-wrap: wrap;
        gap: 10px;
      }

      #header > div:last-child {
        justify-content: space-between;
        gap: 10px;
      }

      .nav-tabs {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
        padding-bottom: 2px;
      }

      .nav-tabs::-webkit-scrollbar {
        display: none;
      }

      .nav-tab {
        flex: 0 0 auto;
        white-space: nowrap;
      }

      .page {
        padding: 18px 16px;
      }

      .toolbar {
        gap: 8px;
      }

      .admin-layout-grid,
      .admin-branding-panel,
      .dashboard-grid,
      .detail-grid,
      .form-grid-2,
      .form-grid-3,
      .transport-item-row {
        grid-template-columns: 1fr;
      }

      .dashboard-filter-period {
        margin-left: 0;
        width: 100%;
      }

      .detail-field.span2 {
        grid-column: span 1;
      }
    }

    @media (max-width: 768px) {
      #main {
        overflow-x: hidden;
      }

      .page {
        padding: 16px 12px;
      }

      .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
      }

      .stat-card {
        padding: 12px 8px;
        border-radius: 10px;
        gap: 4px;
      }

      .stat-value {
        font-size: clamp(18px, 20cqw, 28px);
      }

      .modal-title {
        min-width: 0;
        flex: 1;
        padding-right: 10px;
        font-size: 16px;
        line-height: 1.35;
        word-break: break-word;
      }

      .info-box,
      .transport-card-contact,
      .transport-items-help,
      .muted-help-sm {
        line-height: 1.55;
        word-break: break-word;
      }

      .form-label-inline {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 8px;
      }

      .form-label-inline .btn {
        flex: 0 0 auto;
      }

      .link-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
      }

      .link-row .btn-inline-remove {
        align-self: flex-end;
      }

      .toggle-card {
        padding: 10px 12px;
      }

      .toggle-card-label {
        align-items: flex-start;
      }

      .toggle-card-label > div {
        min-width: 0;
        flex: 1;
      }

      .toggle-card-title {
        display: block;
        line-height: 1.35;
      }

      .split-panel {
        padding: 12px;
      }

      .split-panel-title {
        display: flex;
        flex-wrap: wrap;
        line-height: 1.35;
      }

      .transport-card {
        padding: 12px;
      }

      .transport-item-row {
        gap: 8px;
        padding: 10px;
      }

      .transport-item-row .inp,
      .tp-item-transporter {
        width: 100%;
        min-width: 0;
      }

      .transport-item-toggle {
        justify-self: start;
        flex-wrap: wrap;
        line-height: 1.4;
      }

      .suppliers-table,
      .logs-table {
        min-width: 0;
      }

      .suppliers-table thead,
      .logs-table thead {
        display: none;
      }

      .suppliers-table tbody,
      .logs-table tbody {
        display: block;
      }

      .suppliers-table tbody tr,
      .logs-table tbody tr {
        display: block;
        margin-bottom: 12px;
        padding: 14px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: var(--surface);
      }

      .suppliers-table tbody tr:hover,
      .logs-table tbody tr:hover {
        transform: none;
        box-shadow: none;
      }

      .suppliers-table td,
      .logs-table td {
        display: grid;
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 12px;
        width: 100%;
        padding: 8px 0;
        border: none;
      }

      .suppliers-table td::before,
      .logs-table td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 700;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: .06em;
      }

      .suppliers-table .sup-main-cell,
      .suppliers-table .sup-actions-cell,
      .logs-table .log-note-cell,
      .logs-table .log-request-cell {
        display: block;
      }

      .suppliers-table .sup-actions-cell::before,
      .logs-table .log-note-cell::before,
      .logs-table .log-request-cell::before {
        display: block;
        margin-bottom: 8px;
      }

      .suppliers-table .sup-main-cell::before {
        display: none;
      }

      .suppliers-table .actions,
      .logs-table .actions {
        justify-content: flex-start;
        flex-wrap: wrap;
      }

      .suppliers-table .sup-empty-cell,
      .logs-table .log-empty-cell {
        display: block;
        padding: 40px 18px;
      }

      .suppliers-table .sup-empty-cell::before,
      .logs-table .log-empty-cell::before {
        content: none;
      }

      .logs-head-mobile,
      .logs-toolbar-mobile,
      .logs-filter-meta {
        align-items: stretch;
      }

      .logs-head-mobile,
      .logs-toolbar-mobile {
        gap: 10px;
      }

      .logs-title {
        width: 100%;
      }

      .logs-toolbar-mobile > .btn,
      .logs-toolbar-mobile > .inp,
      .logs-toolbar-mobile > input,
      .logs-toolbar-mobile > .count-badge,
      .logs-filter-meta,
      .logs-filter-meta > input {
        width: 100%;
      }

      .admin-grid-2,
      .admin-grid-portal,
      .admin-grid-cards,
      .admin-usage-grid,
      .admin-billing-grid,
      .admin-health-grid,
      .super-legend-grid,
      .reports-grid {
        grid-template-columns: 1fr;
      }

      .admin-modal-user {
        width: 100%;
      }

      .admin-list-scroll-status-editor,
      .admin-list-scroll-objects {
        max-height: 320px;
      }

      .reports-filter-card,
      .reports-card {
        padding: 18px 16px;
      }

      .reports-filter-row {
        gap: 10px;
      }

      .reports-filter-row > div,
      .reports-date-input,
      .sup-search-input,
      .log-filter-date,
      .log-filter-search {
        width: 100% !important;
      }

      .sup-grid-2 {
        grid-template-columns: 1fr;
      }

      .sup-panel-head {
        align-items: stretch;
      }

      .sup-cell-clip,
      .log-note-cell {
        max-width: none;
        white-space: normal;
        overflow: visible;
        text-overflow: initial;
      }

      .dashboard-wrap {
        padding: 0;
      }

      .dashboard-yearly-head,
      .dashboard-item-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
      }

      .dashboard-card-spaced {
        overflow-x: auto;
      }

      .dashboard-bars {
        min-width: 560px;
      }

      .dashboard-filter-card {
        align-items: stretch;
      }

      .dashboard-filter-card > div {
        width: 100%;
      }

      .dashboard-filter-select {
        width: 100%;
        min-width: 0;
      }

      .dashboard-chip-row {
        flex-wrap: wrap;
      }

      .modal-backdrop {
        padding: 0;
        align-items: stretch;
      }

      .modal,
      .modal-sm,
      .modal-md,
      .modal-lg,
      .modal-narrow {
        max-width: none;
        width: 100%;
        min-height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
        padding: 20px 16px 24px;
      }

      .modal-header {
        position: sticky;
        top: 0;
        z-index: 2;
        background: var(--surface2);
        padding-bottom: 12px;
      }

      .logistic-items-wrap,
      .ops-table-wrap,
      .ops-table-wrap-neutral,
      .ops-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }

      .logistic-items-table,
      .ops-table {
        min-width: 820px;
      }

      .logistic-items-table {
        table-layout: auto;
      }

      .logistic-col-object {
        width: 96px !important;
        min-width: 96px !important;
        max-width: 96px !important;
      }

      .logistic-col-name {
        width: 120px !important;
        min-width: 120px !important;
        max-width: 120px !important;
      }

      .logistic-col-qty,
      .logistic-col-unit {
        width: 40px !important;
        min-width: 40px !important;
      }

      .logistic-col-est,
      .logistic-col-final {
        width: 40px !important;
        min-width: 40px !important;
      }

      .logistic-col-flag,
      .logistic-col-action {
        min-width: 44px;
      }

      .logistic-items-table th:nth-child(2),
      .logistic-items-table td:nth-child(2) {
        width: 120px !important;
        min-width: 120px !important;
        max-width: 120px !important;
        white-space: normal;
        word-break: break-word;
      }

      .logistic-td,
      .logistic-th,
      .ops-cell,
      .ops-th {
        white-space: nowrap;
      }

      .logistic-items-table,
      .ops-table {
        font-size: 11.5px;
        line-height: 1.2;
      }

      .logistic-td-object,
      .ops-cell-object,
      .ops-cell-strong {
        white-space: normal;
        word-break: break-word;
      }

      .logistic-items-table .logistic-sticky-name,
      .ops-table .ops-sticky-name {
        position: sticky;
        left: 0;
        z-index: 4;
        box-sizing: border-box;
        width: 120px !important;
        min-width: 120px !important;
        max-width: 120px !important;
        overflow: hidden;
        white-space: normal;
        word-break: break-word;
        background: var(--surface);
        box-shadow: 10px 0 16px rgba(0, 0, 0, .18);
      }

      .ops-table .ops-wh-col-name,
      .ops-table .ops-it-upload-col-name,
      .ops-table .ops-it-arrived-col-name {
        width: 120px !important;
        min-width: 120px !important;
        max-width: 120px !important;
      }

      .ops-table .ops-wh-col-object,
      .ops-table .ops-it-upload-col-object,
      .ops-table .ops-it-arrived-col-object,
      .logistic-td-object,
      .ops-cell-object {
        width: 96px !important;
        min-width: 96px !important;
        max-width: 96px !important;
      }

      .ops-table .ops-wh-col-qty,
      .ops-table .ops-it-upload-col-qty,
      .ops-table .ops-it-arrived-col-qty,
      .ops-table .ops-wh-col-price,
      .ops-table .ops-wh-col-total,
      .ops-table .ops-it-upload-col-est,
      .ops-table .ops-it-upload-col-final,
      .ops-table .ops-it-upload-col-total,
      .ops-table .ops-it-arrived-col-price,
      .ops-table .ops-it-arrived-col-import {
        width: 40px !important;
        min-width: 40px !important;
      }

      .ops-table tbody .ops-cell-price,
      .ops-table tbody .ops-cell-total,
      .ops-table tbody .ops-cell-subtotal,
      .ops-table tbody .ops-cell-muted,
      .logistic-items-table tbody .logistic-td-muted,
      .logistic-items-table tbody .logistic-td-right {
        width: 40px !important;
        min-width: 40px !important;
        max-width: 72px !important;
        padding-left: 3px !important;
        padding-right: 3px !important;
        text-align: center !important;
        white-space: nowrap;
      }

      .ops-table th:nth-child(n+3),
      .ops-table td:nth-child(n+3),
      .logistic-items-table th:nth-child(n+3),
      .logistic-items-table td:nth-child(n+3) {
        width: 40px;
        min-width: 40px;
        padding-left: 3px;
        padding-right: 3px;
      }

      .ops-table th:nth-child(n+4),
      .ops-table td:nth-child(n+4),
      .logistic-items-table th:nth-child(n+4),
      .logistic-items-table td:nth-child(n+4) {
        max-width: 76px;
      }

      .ops-table .ops-sticky-check {
        position: sticky;
        left: 0;
        z-index: 6;
        width: 42px;
        min-width: 42px;
        max-width: 42px;
        padding-left: 6px;
        padding-right: 6px;
        background: var(--surface);
        box-shadow: 8px 0 14px rgba(0, 0, 0, .16);
      }

      .ops-table-has-check .ops-sticky-name {
        left: 42px;
      }

      .mobile-item-name {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.25;
        max-height: 2.5em;
      }

      .logistic-th,
      .logistic-td,
      .ops-th,
      .ops-cell,
      .ops-cell-sm {
        padding: 6px 4px;
      }

      .logistic-qty-input,
      .logistic-unit-select,
      .logistic-price-input,
      .ops-table-qty-input,
      .ops-table-price-input,
      .ops-import-cost-input,
      .fin-received-price-input {
        box-sizing: content-box;
        width: max(36px, calc((var(--mobile-input-ch, 3) * 1ch) + 8px)) !important;
        min-width: 36px !important;
        max-width: 118px !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
      }

      .logistic-inline-input,
      .ops-table-qty-input,
      .ops-table-price-input,
      .ops-import-cost-input,
      .fin-received-price-input {
        padding-top: 3px !important;
        padding-bottom: 3px !important;
        font-size: 11px !important;
        line-height: 1.15 !important;
      }

      .logistic-price-input,
      .ops-table-price-input,
      .ops-import-cost-input,
      .fin-received-price-input {
        text-align: center !important;
      }

      .logistic-qty-input,
      .ops-table-qty-input {
        text-align: center !important;
      }

      .ops-table .btn,
      .logistic-items-table .btn {
        min-height: 28px;
        padding: 4px 6px;
        font-size: 11px;
        line-height: 1.15;
      }

      .ops-status-chip,
      .detail-chip,
      .fin-status-chip {
        font-size: 10.5px;
        line-height: 1.15;
        padding: 3px 5px;
      }

      .logistic-items-table thead .logistic-sticky-name,
      .ops-table thead .ops-sticky-name {
        z-index: 5;
        background: var(--surface2);
      }

      .ops-table thead .ops-sticky-check {
        z-index: 7;
        background: var(--surface2);
      }

      .logistic-items-table tbody .logistic-sticky-name,
      .ops-table tbody .ops-sticky-name {
        z-index: 4;
        background: var(--surface);
      }

      .modal-footer {
        flex-direction: column;
      }

      .modal-footer .btn {
        width: 100%;
        justify-content: center;
      }
    }

    @media (max-width: 600px) {
      input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
      select,
      textarea,
      .inp,
      .supplier-autocomplete-input,
      .link-row-input,
      .logistic-inline-input,
      .logistic-qty-input,
      .logistic-unit-select,
      .logistic-price-input,
      .ops-table-qty-input,
      .ops-table-price-input,
      .ops-import-cost-input,
      .ops-invoice-number-input,
      .fin-received-price-input,
      .detail-textarea-grow {
        font-size: 16px !important;
      }

      #page-admin .table-wrap,
      #page-suppliers .table-wrap,
      #page-logs .table-wrap,
      #page-reports .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }

      #page-admin .actions,
      #page-suppliers .actions,
      #page-logs .actions,
      #page-reports .actions {
        flex-wrap: wrap;
      }
    }

    @media (max-width: 520px) {
      .user-profile {
        display: none;
      }

      #header {
        padding: 10px 12px;
      }

      .header-brand img {
        height: 24px;
      }

      .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }

    }

    @media (max-width: 650px) {
      .item-row-layout {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 12px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border2);
        border-radius: 10px;
        margin-bottom: 8px;
      }

      .item-row-layout > *:nth-child(1),
      .item-row-layout > *:nth-child(2) {
        grid-column: span 3;
      }

      .item-row-layout .item-qty-input,
      .item-row-layout .item-unit-select,
      .item-row-layout .item-price-input {
        grid-column: span 1;
      }

      .item-row-layout .item-media-actions {
        grid-column: span 2;
      }

      .item-row-layout .item-remove-btn {
        grid-column: span 1;
        justify-self: end;
      }
    }

    @media (max-width: 600px) {
      .login-card {
        padding: 30px 20px;
      }

      #header {
        padding: 0 12px;
        gap: 8px;
      }

      .header-brand img {
        height: 24px;
      }

      .nav-tabs {
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
      }

      .nav-tabs::-webkit-scrollbar {
        display: none;
      }

      .user-profile {
        display: none;
      }

      .page {
        padding: 16px 12px;
      }
    }

    @media (min-width: 800px) {
      .detail-grid {
        grid-template-columns: repeat(3, 1fr);
      }

      .detail-field.span3 {
        grid-column: span 3;
      }
    }


