/* Custom styles for Uniform Inventory */

:root {
    --brand-blue: #042F66;
    --brand-gold: #BCAB82;
    --ink: #505050;
    --muted-text: #667085;
    --surface: #ffffff;
    --page-bg: #f4f6f8;
    --line: #e5e7eb;
    --hover-surface: #f1f6fc;
    --table-head: #f8fafc;
    --chip-bg: #f8fafc;
    --danger: #c0392b;
    --shadow: rgba(15, 23, 42, 0.06);
    --focus-ring: rgba(4, 47, 102, 0.12);
    color-scheme: light;
}

[data-bs-theme="dark"] {
    --brand-blue: #9ec5ea;
    --brand-gold: #d4c49a;
    --ink: #e8eef6;
    --muted-text: #9aabbc;
    --surface: #1b2433;
    --page-bg: #101822;
    --line: #2f3b4d;
    --hover-surface: #243247;
    --table-head: #182233;
    --chip-bg: #222c3d;
    --danger: #f07167;
    --shadow: rgba(0, 0, 0, 0.45);
    --focus-ring: rgba(158, 197, 234, 0.28);
    color-scheme: dark;
}

body {
    font-family: 'Work Sans', sans-serif;
    background: var(--page-bg);
    color: var(--ink);
}

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 12%, rgba(188, 171, 130, 0.28), transparent 32%),
        linear-gradient(145deg, #021f43 0%, #042f66 58%, #0c4f88 100%);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.login-card {
    width: min(100%, 440px);
    padding: clamp(1.75rem, 5vw, 3rem);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 1.25rem;
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.26);
}

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

.login-brand h1 {
    margin: 0;
    color: #042f66;
    font-size: clamp(1.75rem, 6vw, 2.25rem);
}

.login-eyebrow {
    margin: 0 0 0.15rem;
    color: #8c7850;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.login-card .btn-primary,
.access-card + .btn-primary {
    background: #042f66;
    border-color: #042f66;
}

.inventory-account-link:hover {
    transform: none;
}

.inventory-account-identity {
    color: rgba(255, 255, 255, 0.85);
}

.inventory-account-name {
    font-weight: 600;
    color: #fff;
}

.navbar-module {
    white-space: nowrap;
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .navbar-module { display: none !important; }
}

.inventory-bell-host {
    position: relative;
    margin-left: auto;
}

.inventory-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
}

.inventory-bell:hover,
.inventory-bell:focus {
    color: #bcab82;
}

.inventory-bell-badge {
    position: absolute;
    top: 0.2rem;
    right: 0.15rem;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #c0392b;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.05rem;
    text-align: center;
}

.inventory-bell-menu {
    width: min(32rem, calc(100vw - 1.5rem));
    max-height: min(28rem, 70vh);
    overflow: auto;
    padding: 0;
    margin-top: 0.4rem;
}

.inventory-bell-head {
    padding: 0.7rem 0.9rem 0.35rem;
    font-weight: 600;
    color: #042f66;
}

.inventory-bell-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem 0.5rem;
    font-size: 0.9rem;
}

.inventory-bell-email,
.inventory-bell-actions {
    padding: 0 0.9rem 0.65rem;
}

.inventory-bell-item {
    display: block;
    width: 100%;
    overflow: hidden;
    padding: 0.55rem 0.9rem;
    border: 0;
    background: transparent;
    color: #042f66;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
    line-height: 1.35;
}

.inventory-bell-item:hover,
.inventory-bell-item:focus {
    background: #f1f6fc;
}

.inventory-bell-item.is-read {
    color: #6c7a89;
}

.inventory-release-dialog {
    width: min(30rem, calc(100vw - 1.5rem));
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow: auto;
    padding: 1.1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.65rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.inventory-release-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.inventory-release-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.inventory-release-notes { padding-left: 1.2rem; }
.inventory-release-notes li + li { margin-top: 0.45rem; }
.inventory-release-latest { margin-bottom: 1rem; font-size: 0.9rem; }
.inventory-release-symbol { display: none; }
.stock-take-save-state { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; color: var(--muted-text); font-size: 0.85rem; }
.stock-take-save-state:has(#stockTakeSaveStatus:empty):has(#reloadChecksButton.d-none) { display: none; }
.stock-take-line-state { color: var(--muted-text); font-size: 0.85rem; margin: 0.5rem 0 0; }
.stock-take-line-state:empty { display: none; }
.stock-take-line-state.is-warning { color: var(--danger); }
#stockTakeMessage .alert { min-width: 0; animation: none; }
@media (min-width: 992px) {
    .inventory-account .inventory-release-label { display: none; }
    .inventory-account .inventory-release-symbol { display: inline; font-size: 1.1rem; line-height: 1; }
    .inventory-account .inventory-release-link { width: 2.25rem; height: 2rem; padding: 0; flex-shrink: 0; }
}
.inventory-update-notice {
    position: fixed;
    z-index: 1050;
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    left: max(0.75rem, env(safe-area-inset-left));
    width: max-content;
    max-width: calc(100vw - 1.5rem);
    margin-left: auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.65rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.65rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
}

@media (min-width: 992px) {
    .navbar .container-fluid,
    .navbar .container {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
    }

    .navbar-expand-lg .navbar-collapse,
    .navbar-collapse {
        display: contents !important;
    }

    .navbar-nav {
        order: 1;
    }

    .inventory-theme-host {
        order: 2;
        margin-left: auto;
    }

    .inventory-bell-host {
        order: 2;
        margin-left: 0.15rem;
    }

    .navbar-toggler {
        order: 5;
    }
}

@media (max-width: 991.98px) {
    .navbar .container-fluid,
    .navbar .container {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    .inventory-theme-host {
        order: 2;
        margin-left: auto;
        margin-right: 0.15rem;
    }

    .inventory-bell-host {
        order: 2;
        margin-left: 0;
    }

    .inventory-bell-menu {
        position: fixed !important;
        inset: var(--inventory-bell-top, 4rem) max(0.75rem, env(safe-area-inset-right)) auto max(0.75rem, env(safe-area-inset-left)) !important;
        width: auto;
        min-width: 0;
        max-height: min(28rem, calc(100vh - var(--inventory-bell-top, 4rem) - 1rem));
        max-height: min(28rem, calc(100dvh - var(--inventory-bell-top, 4rem) - max(1rem, env(safe-area-inset-bottom))));
        margin: 0;
        transform: none !important;
    }

    .navbar-toggler {
        order: 3;
        margin-left: 0.15rem;
    }

    .navbar-collapse {
        order: 4;
        flex-basis: 100%;
    }
}

.module-chooser {
    max-width: 46rem;
    margin: 1.5rem auto 0;
}

.module-card {
    display: block;
    height: 100%;
    padding: 1.35rem 1.4rem;
    color: inherit;
    text-decoration: none;
    background: #fff;
}

.module-card:hover,
.module-card:focus {
    color: inherit;
    box-shadow: 0 0.6rem 1.8rem rgba(4, 47, 102, 0.14);
}

.access-card {
    overflow: hidden;
    border: 0;
    border-radius: 0.9rem;
    box-shadow: 0 0.4rem 1.5rem rgba(4, 47, 102, 0.08);
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.permission-option {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.8rem;
    border: 1px solid #dfe5ec;
    border-radius: 0.65rem;
    background: #fff;
    cursor: pointer;
}

.permission-option:has(input:checked) {
    border-color: #8ea9c8;
    background: #f1f6fc;
}

.permission-option .form-check-input {
    flex: 0 0 auto;
    margin: 0.15rem 0 0;
}

/* Navbar styles */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background-color: #042F66 !important;
}

.navbar .navbar-brand,
.navbar .nav-link,
.navbar .navbar-toggler {
    color: #fff !important;
}

.navbar .nav-link.active {
    color: #bcab82 !important;
}

.navbar .nav-link:not(.active):hover {
    color: #bcab82 !important;
}

@media (min-width: 992px) {
    .navbar-nav {
        order: 1;
    }

    .inventory-account-identity {
        order: 3;
        display: flex;
        align-items: center;
        gap: 0.4rem;
        margin-left: 0;
        padding: 0 0.75rem 0 0.35rem;
        white-space: nowrap;
        font-size: 0.9rem;
    }

    .inventory-account-vessel::before {
        content: "·";
        margin-right: 0.4rem;
        opacity: 0.7;
    }

    .inventory-account {
        order: 4;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
}

@media (max-width: 991.98px) {
    .navbar-collapse.show,
    .navbar-collapse.collapsing {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        padding-bottom: 0.35rem;
    }

    .inventory-account-identity {
        order: -1;
        padding: 0.55rem 0 0.8rem;
        margin-bottom: 0.15rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    }

    .inventory-account-name,
    .inventory-account-vessel {
        display: block;
        line-height: 1.3;
    }

    .inventory-account-name {
        font-size: 1.05rem;
    }

    .inventory-account-vessel {
        margin-top: 0.15rem;
        font-size: 0.82rem;
        color: rgba(255, 255, 255, 0.7);
    }

    .navbar-nav .nav-link {
        padding-top: 0.7rem;
        padding-bottom: 0.7rem;
    }

    .inventory-account {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-top: 0.25rem;
        padding-top: 0.2rem;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
    }

    .inventory-account-link {
        display: block;
        width: 100%;
        margin: 0;
        padding: 0.7rem 0;
        border: 0 !important;
        background: none !important;
        box-shadow: none !important;
        color: #fff !important;
        text-align: left;
        text-decoration: none;
        font-size: 1rem;
        line-height: 1.25;
        min-height: 2.75rem;
    }

    .inventory-account-link:hover,
    .inventory-account-link:focus {
        color: #bcab82 !important;
        transform: none;
    }
}

/* Button styles */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Stock list styles */
.uniform-section {
    margin-bottom: 2rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    overflow: hidden;
}

.section-header {
    background-color: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
}

.add-uniform-btn {
    color: #bcab82;
    text-decoration: none;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.add-uniform-btn:hover {
    color: #000;
}

.uniform-table {
    margin: 0;
}

.uniform-table th {
    background-color: #f8f9fa;
}

.action-links {
    display: flex;
    gap: 1rem;
}

.action-links a {
    text-decoration: none;
    transition: color 0.3s ease;
}

.update-stock-link {
    color: #bcab82;
}

.update-stock-link:hover {
    color: #000;
}

.delete-link {
    color: #dc3545;
}

.delete-link:hover {
    color: #dc3545;
    opacity: 0.8;
}

/* Modal styles */
.modal-header {
    background-color: #f8f9fa;
}

.modal-footer {
    background-color: #f8f9fa;
}

/* Flash message styles */
.alert {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1050;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .action-links {
        justify-content: center;
    }

    .permission-grid {
        grid-template-columns: 1fr;
    }

    .users-table thead {
        display: none;
    }

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

    .users-table tbody {
        padding: 0.65rem;
    }

    .users-table tbody tr {
        margin-bottom: 0.75rem;
        padding: 0.45rem 0.75rem;
        border: 1px solid #dfe5ec;
        border-radius: 0.7rem;
        background: #fff;
    }

    .users-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .users-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.55rem 0;
        border: 0;
        white-space: normal;
        text-align: right !important;
        overflow: visible;
    }

    .users-table tbody td::before {
        content: attr(data-label);
        flex: 0 0 5.5rem;
        color: #6c757d;
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.04em;
        text-align: left;
        text-transform: uppercase;
    }

    .users-table tbody td[data-label="Actions"] {
        justify-content: flex-end;
        padding-top: 0.75rem;
        border-top: 1px solid #edf0f4;
    }

    .users-table tbody td[data-label="Actions"]::before {
        margin-right: auto;
    }
}

/* Stock Management Button Styles */
.btn-stock-action {
    background-color: #BCAB82;
    color: white;
    border: none;
    transition: all 0.3s ease;
    padding: 0.3rem 0.6rem;
    font-size: 0.95rem;
    height: 2rem;
    min-width: 2rem;
    line-height: 1.1;
}

.btn-stock-action:hover {
    background-color: #042F66;
    color: #BCAB82;
    border: none;
}

/* Remove default Bootstrap button styles */
.btn-stock-action.btn-outline-primary,
.btn-stock-action.btn-outline-danger {
    background-color: #BCAB82;
    color: white;
    border: none;
}

.btn-stock-action.btn-outline-primary:hover,
.btn-stock-action.btn-outline-danger:hover {
    background-color: #042F66;
    color: #BCAB82;
    border: none;
}

/* Table styles */
.table {
    font-family: 'Work Sans', sans-serif;
    color: #505050;
    font-size: 13px;
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: #505050;
    font-size: 13px;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table td {
    font-weight: 400;
    color: #505050;
    font-size: 13px;
    padding: 6px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.assigned-count {
    font-weight: 600;
    text-decoration: none;
    color: inherit;
}

.assigned-count:hover,
.assigned-count:focus {
    text-decoration: underline;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Adjust card styles to match new table size */
.card {
    margin-bottom: 1rem;
}

.card-header {
    padding: 0.75rem 1rem;
}

.card-body {
    padding: 0.75rem;
}

/* Make action icons 1px smaller */
.btn-stock-action .bi {
    font-size: 15px;
    vertical-align: middle;
}

/* Utility class for button text */
.btn-stock-action .btn-text {
    display: inline;
}

@media (max-width: 770px) {
    .container .d-flex.gap-2 .btn-stock-action {
        min-width: 2.2rem;
        padding: 0.25rem 0.25rem;
        font-size: 1.1rem;
        white-space: nowrap;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    /* Prevent action buttons from stacking and reduce gap/padding */
    .d-flex.gap-2 {
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
    }
    .btn-stock-action {
        padding: 0.25rem 0.4rem;
        font-size: 0.9rem;
        height: 1.7rem;
        min-width: 1.7rem;
    }
    .table td,
    .table th {
        padding: 3px 6px;
    }
    /* Hide text in top bar .btn-stock-action buttons, keep only icon (corrected selector) */
    .container .d-flex.gap-2 .btn-stock-action .btn-text {
        display: none !important;
    }
}

/* Custom dropdown for uniform search */
.custom-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  max-height: 320px;
  overflow-y: auto;
  margin-top: 2px;
  padding: 0;
  border: 1px solid #e0e0e0;
  display: none;
}
.custom-dropdown-item {
  padding: 12px 18px;
  cursor: pointer;
  font-size: 16px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  transition: background 0.15s;
}
.custom-dropdown-item:last-child {
  border-bottom: none;
}
.custom-dropdown-item:hover, .custom-dropdown-item.active {
  background: #f5f7fa;
} 

/* Modern stock UI refresh */
body {
    background: var(--page-bg);
    color: var(--ink);
    font-family: 'Work Sans', sans-serif;
}

.navbar {
    box-shadow: 0 10px 30px rgba(4, 47, 102, 0.18);
}

.card {
    border: 1px solid rgba(4, 47, 102, 0.08);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.card-header h5 {
    color: var(--brand-blue);
    font-weight: 600;
}

.form-control,
.form-select {
    border-radius: 10px;
    border-color: #d9dee7;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 0.18rem rgba(4, 47, 102, 0.12);
}

.btn-stock-action {
    border-radius: 999px;
    box-shadow: none;
}

.table th {
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    color: var(--brand-blue);
    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.table td {
    border-color: #eef1f5;
}

.stock-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.stock-total {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    height: 1.8rem;
    padding: 0 0.55rem;
    border-radius: 999px;
    background: rgba(4, 47, 102, 0.08);
    color: var(--brand-blue);
    font-weight: 700;
}

.location-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 12rem;
    min-width: 0;
    border: 1px solid rgba(188, 171, 130, 0.45);
    border-radius: 999px;
    background: rgba(188, 171, 130, 0.12);
    color: #6f613f;
    font-size: 12px;
    line-height: 1.1;
    padding: 0.35rem 0.55rem;
}

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

.location-chip:hover,
.location-chip:focus {
    background: var(--brand-gold);
    color: #fff;
}

.row-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.vessel-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.2rem;
    border-radius: 999px;
    background: rgba(4, 47, 102, 0.09);
    color: var(--brand-blue);
    font-size: 11px;
    font-weight: 700;
    padding: 0.2rem 0.45rem;
}

.location-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: #f8fafc;
    color: var(--brand-blue);
}

.location-total strong {
    font-size: 1.25rem;
}

.location-detail-table th,
.location-detail-table td {
    white-space: normal;
}

@media (max-width: 640px) {
    body {
        background: #fff;
    }

    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    .card {
        border-radius: 12px;
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    }

    .card-body {
        padding: 0;
    }

    .table-responsive {
        overflow: visible;
    }

    .table thead {
        display: none;
    }

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

    .table tbody tr {
        margin: 0.55rem 0.65rem;
        padding: 0.65rem;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #fff;
    }

    .table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.32rem 0;
        border: 0;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: #7a8493;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .stock-compact,
    .row-actions {
        justify-content: flex-end;
    }

    .location-chip {
        max-width: 9.5rem;
    }
}

/* Icon-only stock location trigger */
.location-chip-icon {
    width: 1.9rem;
    min-width: 1.9rem;
    height: 1.9rem;
    justify-content: center;
    padding: 0;
    border-radius: 999px;
}

.location-chip-icon .bi {
    font-size: 14px;
    line-height: 1;
}

@media (max-width: 640px) {
    .stock-compact {
        gap: 0.35rem;
    }

    .stock-total {
        min-width: 2rem;
        height: 1.7rem;
        padding: 0 0.45rem;
    }

    .location-chip-icon {
        width: 1.75rem;
        min-width: 1.75rem;
        height: 1.75rem;
    }

    .table td[data-label="Stock"] {
        align-items: center;
    }
}

/* Compact mobile stock rows */
@media (max-width: 640px) {
    .table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas:
            "size stock actions"
            "color assigned actions";
        align-items: center;
        column-gap: 0.65rem;
        row-gap: 0.35rem;
        margin: 0.5rem 0.65rem;
        padding: 0.65rem 0.7rem;
        background: #fff;
    }

    .table td {
        display: flex;
        min-width: 0;
        padding: 0;
        justify-content: flex-start;
    }

    .table td::before {
        display: none;
    }

    .table td[data-label="Size"] {
        grid-area: size;
        font-size: 15px;
        font-weight: 700;
        color: var(--brand-blue);
    }

    .table td[data-label="Color"] {
        grid-area: color;
        font-size: 13px;
        color: #6b7280;
    }

    .table td[data-label="Stock"] {
        grid-area: stock;
        justify-content: flex-end;
    }

    .table td[data-label="Assigned"] {
        grid-area: assigned;
        justify-content: flex-end;
        font-weight: 700;
    }

    .table td[data-label="Actions"] {
        grid-area: actions;
        justify-content: flex-end;
        align-self: stretch;
    }

    .stock-compact {
        justify-content: flex-end;
    }

    .row-actions {
        height: 100%;
        flex-direction: column;
        justify-content: center;
        gap: 0.35rem;
    }

    .table td[data-label="Actions"] .btn-stock-action {
        width: 1.9rem;
        min-width: 1.9rem;
        height: 1.9rem;
        padding: 0;
    }

    .assigned-count {
        font-size: 15px;
    }
}

/* Clearer mobile inventory cards */
@media (max-width: 640px) {
    .table tbody tr {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        grid-template-areas:
            "size size actions"
            "color color actions"
            "stock assigned actions";
        row-gap: 0.45rem;
        column-gap: 0.6rem;
        padding: 0.78rem;
    }

    .table td[data-label="Size"] {
        font-size: 16px;
        line-height: 1.2;
    }

    .table td[data-label="Color"] {
        font-size: 13px;
        line-height: 1.2;
        margin-top: -0.12rem;
    }

    .table td[data-label="Stock"],
    .table td[data-label="Assigned"] {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.25rem;
        justify-content: stretch;
        align-items: stretch;
        min-height: 3.2rem;
        padding: 0.48rem 0.55rem;
        border: 1px solid #edf0f4;
        border-radius: 12px;
        background: #f8fafc;
    }

    .table td[data-label="Stock"]::before,
    .table td[data-label="Assigned"]::before {
        content: attr(data-label);
        display: block;
        color: #7a8493;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .table td[data-label="Stock"] {
        grid-area: stock;
    }

    .table td[data-label="Assigned"] {
        grid-area: assigned;
    }

    .stock-compact {
        justify-content: space-between;
        gap: 0.4rem;
    }

    .stock-total {
        min-width: 0;
        height: auto;
        padding: 0;
        background: transparent;
        color: var(--brand-blue);
        font-size: 18px;
        line-height: 1;
    }

    .location-chip-icon {
        width: 1.7rem;
        min-width: 1.7rem;
        height: 1.7rem;
        background: #fff;
    }

    .table td[data-label="Assigned"] {
        color: var(--brand-blue);
        font-size: 18px;
        line-height: 1;
    }

    .table td[data-label="Assigned"] > span,
    .table td[data-label="Assigned"] > button {
        justify-self: start;
    }

    .assigned-count {
        color: var(--brand-blue);
        font-size: 18px;
        font-weight: 700;
        line-height: 1;
    }

    .row-actions {
        align-items: center;
        padding-left: 0.15rem;
    }

    .table td[data-label="Actions"] .btn-stock-action {
        width: 2rem;
        min-width: 2rem;
        height: 2rem;
    }
}

/* Final mobile stock row alignment */
@media (max-width: 640px) {
    .table tbody tr {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "size color actions"
            "stock assigned assigned";
        align-items: center;
        column-gap: 0.5rem;
        row-gap: 0.45rem;
        padding: 0.62rem 0.7rem;
    }

    .table td[data-label="Size"] {
        grid-area: size;
        align-self: center;
        font-size: 15px;
        line-height: 1.1;
        white-space: nowrap;
    }

    .table td[data-label="Color"] {
        grid-area: color;
        align-self: center;
        min-width: 0;
        margin-top: 0;
        font-size: 14px;
        line-height: 1.1;
        color: #6b7280;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .table td[data-label="Actions"] {
        grid-area: actions;
        align-self: center;
        justify-self: end;
    }

    .row-actions {
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 0.35rem;
        height: auto;
        padding-left: 0;
    }

    .table td[data-label="Actions"] .btn-stock-action {
        width: 1.85rem;
        min-width: 1.85rem;
        height: 1.85rem;
    }

    .table td[data-label="Stock"],
    .table td[data-label="Assigned"] {
        min-height: 2.55rem;
        height: 2.55rem;
        padding: 0.42rem 0.5rem;
        align-content: center;
    }

    .table td[data-label="Stock"] {
        grid-area: stock;
    }

    .table td[data-label="Assigned"] {
        grid-area: assigned;
    }

    .stock-compact {
        height: 1.25rem;
    }

    .stock-total,
    .assigned-count,
    .table td[data-label="Assigned"] > span {
        font-size: 17px;
        line-height: 1;
    }

    .location-chip-icon {
        width: 1.55rem;
        min-width: 1.55rem;
        height: 1.55rem;
    }
}

/* Mobile title and metric sizing refinements */
.uniform-title {
    min-width: 0;
    max-width: min(100%, 28rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .card-header {
        gap: 0.65rem;
    }

    .card-header .uniform-title {
        max-width: calc(100vw - 8rem);
    }

    .table tbody tr {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "size color actions"
            "metrics metrics metrics";
    }

    .table td[data-label="Stock"],
    .table td[data-label="Assigned"] {
        width: 7.45rem;
        min-height: 3.15rem;
        height: 3.15rem;
        padding: 0.5rem 0.65rem;
    }

    .table td[data-label="Stock"] {
        grid-area: metrics;
        justify-self: start;
    }

    .table td[data-label="Assigned"] {
        grid-area: metrics;
        justify-self: start;
        margin-left: 7.9rem;
    }

    .stock-compact {
        height: 1.55rem;
    }

    .location-chip-icon {
        width: 1.72rem;
        min-width: 1.72rem;
        height: 1.72rem;
    }
}


/* Assignment history compact layout */
.assignment-history-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.assignment-history-table {
    table-layout: auto;
    width: 100%;
    min-width: 70rem;
}

.history-assigned-date-col { width: 6.3rem; }
.history-returned-date-col { width: 6.3rem; }
.history-staff-col { width: 5.8rem; }
.history-department-col { width: 7.4rem; }
.history-uniform-col { width: 10.5rem; }
.history-size-col { width: 4.4rem; }
.history-color-col { width: 4.6rem; }
.history-assigned-by-col { width: 6rem; }
.history-condition-col { width: 5.7rem; }
.history-qty-col { width: 2.4rem; }
.history-status-col { width: 5.6rem; }
.history-comment-col { width: 7rem; }
.history-select-col { width: 2.4rem; }

.assignment-history-table th,
.assignment-history-table td {
    padding: 0.46rem 0.32rem;
    white-space: nowrap;
    overflow-wrap: normal;
    vertical-align: middle;
}

.assignment-history-table thead th {
    color: #667085;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.history-dates-header {
    padding-top: 0.42rem !important;
    padding-bottom: 0.42rem !important;
}

.history-sort-button {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: 1.25;
    padding: 0.08rem 0;
    text-align: left;
}

.history-sort-button:hover,
.history-sort-button:focus {
    color: var(--brand-blue);
}

.history-condition-header {
    line-height: 1.08;
}

.history-staff-cell span,
.history-uniform-type-cell span,
.history-note,
.history-comment-cell {
    color: #7a8493;
    font-size: 0.76rem;
    font-weight: 500;
}

.history-staff-cell strong,
.history-uniform-type-cell strong {
    color: #344054;
    font-size: 0.86rem;
    font-weight: 400;
}

.history-staff-cell strong,
.history-staff-cell span,
.history-uniform-type-cell strong,
.history-uniform-type-cell span,
.history-status-cell .history-note {
    display: block;
}

.history-uniform-type-cell strong,
.history-status-cell .history-note {
    white-space: nowrap;
}

.history-status-cell {
    min-width: 0;
}

.history-status-cell .badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin-bottom: 0.12rem;
}

.history-comment-cell {
    max-width: 7rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-qty-cell {
    color: #344054 !important;
    font-weight: 400;
}

.assignment-history-table .history-staff-cell,
.assignment-history-table .history-uniform-type-cell,
.assignment-history-table td[data-label="Assigned by"] {
    max-width: 14rem;
}

.assignment-history-table .history-staff-cell span,
.assignment-history-table .history-uniform-type-cell span {
    white-space: nowrap;
}

.assignment-history-table .history-status-cell {
    white-space: nowrap;
}

@media (min-width: 641px) and (max-width: 1280px) {
    .assignment-history-table {
        min-width: 64rem;
    }

    .assignment-history-table th,
    .assignment-history-table td {
        padding-left: 0.26rem;
        padding-right: 0.26rem;
        font-size: 0.78rem;
    }

    .history-assigned-date-col { width: 5.9rem; }
    .history-returned-date-col { width: 5.9rem; }
    .history-staff-col { width: 5.4rem; }
    .history-department-col { width: 6.8rem; }
    .history-uniform-col { width: 9.6rem; }
    .history-size-col { width: 4rem; }
    .history-color-col { width: 4.2rem; }
    .history-assigned-by-col { width: 5.4rem; }
    .history-condition-col { width: 5.2rem; }
    .history-qty-col { width: 2.2rem; }
    .history-status-col { width: 4.8rem; }
    .history-comment-col { width: 6.2rem; }

    .history-staff-cell span,
    .history-uniform-type-cell span,
    .history-note,
    .history-comment-cell {
        font-size: 0.7rem;
    }

    .history-staff-cell strong,
    .history-uniform-type-cell strong {
        font-size: 0.8rem;
    }

    .assignment-history-table .badge {
        font-size: 0.68rem;
        padding: 0.32em 0.48em;
    }
}

@media (max-width: 640px) {
    .assignment-history-table,
    .assignment-history-table tbody,
    .assignment-history-table tr,
    .assignment-history-table td {
        display: block;
        width: 100%;
    }

    .assignment-history-table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "uniform status"
            "staff qty"
            "department department"
            "assignedby returnedby"
            "assigneddate returneddate"
            "assignedcond returnedcond"
            "comment comment"
            "select select";
        gap: 0.45rem 0.75rem;
    }

    .assignment-history-table td {
        padding: 0;
    }

    .assignment-history-table td::before {
        content: none;
    }

    .assignment-history-table .history-date-cell[data-label="Assigned Date"] { grid-area: assigneddate; }
    .assignment-history-table .history-date-cell[data-label="Returned Date"] { grid-area: returneddate; }
    .assignment-history-table .history-staff-cell { grid-area: staff; }
    .assignment-history-table td[data-label="Department"] { grid-area: department; }
    .assignment-history-table .history-uniform-type-cell { grid-area: uniform; }
    .assignment-history-table td[data-label="Assigned by"] { grid-area: assignedby; }
    .assignment-history-table .history-assigned-condition-cell { grid-area: assignedcond; }
    .assignment-history-table .history-returned-condition-cell { grid-area: returnedcond; }
    .assignment-history-table .history-qty-cell { grid-area: qty; }
    .assignment-history-table .history-status-cell { grid-area: status; text-align: right; }
    .assignment-history-table .history-comment-cell { grid-area: comment; }
    .assignment-history-table .history-select-cell { grid-area: select; }

    .assignment-history-table .history-date-cell {
        padding-top: 0.35rem;
        border-top: 1px solid var(--line);
    }
}


/* Assignment history mobile cards */
@media (max-width: 640px) {
    .assignment-history-responsive {
        overflow: visible;
    }

    .assignment-history-table,
    .assignment-history-table tbody {
        display: block;
        width: 100%;
    }

    .assignment-history-table thead,
    .assignment-history-table colgroup,
    #historyTable:not(.history-table-edit) .history-select-header,
    #historyTable:not(.history-table-edit) .history-select-cell {
        display: none !important;
    }

    .assignment-history-table tbody tr {
        display: grid;
        width: auto;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "uniform uniform"
            "staff status"
            "department department"
            "assignedby returnedby"
            "assigneddate returneddate"
            "assignedcond returnedcond"
            "comment comment"
            "qty qty"
            "select select";
        align-items: start;
        gap: 0.5rem;
        margin: 0.62rem 0.65rem;
        padding: 0.72rem;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #fff;
    }

    .assignment-history-table td {
        display: block;
        width: auto;
        min-width: 0;
        padding: 0;
        border: 0;
        color: #344054;
        font-size: 0.86rem;
        font-weight: 400;
        line-height: 1.25;
        text-align: left;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .assignment-history-table td::before {
        content: none !important;
        display: none !important;
    }

    .assignment-history-table .history-uniform-type-cell {
        grid-area: uniform;
    }

    .assignment-history-table .history-staff-cell {
        grid-area: staff;
    }

    .assignment-history-table .history-status-cell {
        grid-area: status;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding-top: 0.45rem;
        border-top: 1px solid var(--line);
        text-align: left;
    }

    .assignment-history-table .history-status-cell::before {
        content: "Status" !important;
        display: block !important;
        color: #7a8493;
        font-size: 0.72rem;
        font-weight: 500;
        text-transform: uppercase;
    }

    .assignment-history-table .history-qty-cell {
        grid-area: qty;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-top: 0.45rem;
        border-top: 1px solid var(--line);
        text-align: left;
    }

    .assignment-history-table .history-qty-cell::before {
        content: "Quantity" !important;
        display: block !important;
        color: #7a8493;
        font-size: 0.72rem;
        font-weight: 500;
        text-transform: uppercase;
    }

    .assignment-history-table .history-date-cell[data-label="Assigned Date"] { grid-area: assigneddate; }
    .assignment-history-table .history-date-cell[data-label="Returned Date"] { grid-area: returneddate; }
    .assignment-history-table td[data-label="Department"] { grid-area: department; }
    .assignment-history-table .history-assigned-condition-cell { grid-area: assignedcond; }
    .assignment-history-table .history-returned-condition-cell { grid-area: returnedcond; }
    .assignment-history-table .history-comment-cell { grid-area: comment; }

    .assignment-history-table td[data-label="Assigned by"] {
        grid-area: assignedby;
        display: flex;
        justify-content: space-between;
        gap: 0.75rem;
        padding-top: 0.45rem;
        border-top: 1px solid var(--line);
        color: #344054;
    }

    .assignment-history-table td[data-label="Assigned by"]::before {
        content: "Assigned by" !important;
        display: block !important;
        color: #7a8493;
        font-size: 0.72rem;
        font-weight: 500;
        text-transform: uppercase;
    }

    .assignment-history-table td[data-label="Assigned by"]::after {
        content: none;
    }

    .assignment-history-table .history-select-cell {
        grid-area: select;
        text-align: right;
    }

    #historyTable.history-table-edit .history-select-cell {
        display: block !important;
    }

    .assignment-history-table .history-date-cell {
        padding-top: 0.45rem;
        border-top: 1px solid var(--line);
    }

    .assignment-history-table .history-cell-stack {
        grid-template-rows: repeat(2, 1.08rem);
        row-gap: 0.06rem;
    }

    .assignment-history-table .history-cell-stack span,
    .assignment-history-table .history-staff-cell span,
    .assignment-history-table .history-uniform-type-cell span,
    .assignment-history-table .history-note,
    .assignment-history-table .history-comment-cell {
        color: #7a8493;
        font-size: 0.74rem;
        font-weight: 500;
    }

    .assignment-history-table .history-cell-stack span,
    .assignment-history-table .history-cell-stack strong,
    .assignment-history-table .history-staff-cell strong,
    .assignment-history-table .history-uniform-type-cell strong {
        color: #344054;
        font-size: 0.9rem;
        font-weight: 400;
    }

    .assignment-history-table .history-uniform-type-cell strong {
        color: var(--brand-blue);
        font-weight: 500;
    }


    .assignment-history-table .history-status-cell .badge {
        flex: 0 0 auto;
        margin-bottom: 0;
        white-space: nowrap;
    }

    .assignment-history-table .history-status-cell .history-note {
        max-width: 9rem;
        text-align: right;
        white-space: nowrap;
    }
}


/* Assignment history mobile overflow guard */
@media (max-width: 640px) {
    body:has(.assignment-history-table) {
        overflow-x: hidden;
    }

    body:has(.assignment-history-table) .container,
    body:has(.assignment-history-table) .card,
    body:has(.assignment-history-table) .card-body,
    body:has(.assignment-history-table) .assignment-history-responsive,
    body:has(.assignment-history-table) .assignment-history-table,
    body:has(.assignment-history-table) #historyList {
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    body:has(.assignment-history-table) .card {
        width: 100%;
    }

    .assignment-history-table tbody tr {
        width: calc(100vw - 2.2rem);
        max-width: calc(100vw - 2.2rem);
        box-sizing: border-box;
    }

    .assignment-history-table .history-status-cell,
    .assignment-history-table .history-qty-cell,
    .assignment-history-table td[data-label="Assigned by"] {
        display: grid;
        grid-template-columns: minmax(0, 6.2rem) minmax(0, 1fr);
        align-items: center;
        justify-content: initial;
        gap: 0.55rem;
    }

    .assignment-history-table .history-status-cell {
        text-align: left;
    }

    .assignment-history-table .history-status-cell .badge,
    .assignment-history-table .history-status-cell .history-note,
    .assignment-history-table .history-qty-cell,
    .assignment-history-table td[data-label="Assigned by"] {
        justify-self: start;
    }

    .assignment-history-table .history-status-cell .history-note {
        max-width: 100%;
        text-align: left;
    }
}


/* Assignment history mobile header */
@media (max-width: 640px) {
    body:has(.assignment-history-table) .container > .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
    }

    body:has(.assignment-history-table) .container > .d-flex.justify-content-between > .d-flex {
        width: 100%;
        justify-content: flex-start !important;
    }

    .assignment-history-table .history-qty-cell {
        text-align: left !important;
    }
}

/* Stock management compact row table */
.stock-filter-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: end;
    gap: 0.65rem 0.75rem;
}

.stock-search-field {
    flex: 1 1 auto;
    min-width: 0;
}

.stock-filter-selects {
    display: grid;
    grid-template-columns: repeat(4, 7.25rem);
    gap: 0.5rem 0.65rem;
    flex: 0 0 auto;
}

.stock-filter {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    margin: 0;
}

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

.stock-filter-label {
    color: #667085;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.stock-filter-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.4rem;
    flex: 0 0 auto;
}

.stock-match-count {
    color: #667085;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

#clearStockFilters {
    color: var(--brand-blue);
    text-decoration: none;
    font-weight: 600;
}

#clearStockFilters:hover {
    text-decoration: underline;
}

.stock-empty-filter {
    padding: 1.25rem 0.15rem;
}

@media (max-width: 991.98px) and (min-width: 768px) {
    .stock-filter-selects {
        grid-template-columns: repeat(4, 6.25rem);
    }
}

@media (max-width: 767.98px) {
    .stock-filter-bar {
        flex-wrap: wrap;
    }

    .stock-search-field {
        flex: 1 1 100%;
    }

    .stock-filter-selects {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        flex: 1 1 100%;
    }

    .stock-filter-meta {
        width: 100%;
        min-height: 0;
    }
}

.stock-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.stock-management-table {
    table-layout: auto;
    width: 100%;
    min-width: 38rem;
    margin-bottom: 0;
}

.stock-size-col { width: 8rem; }
.stock-color-col { width: 10rem; }
.stock-current-col { width: 8rem; }
.stock-assigned-col { width: 7rem; }
.stock-actions-col { width: 7rem; }

.stock-management-table th,
.stock-management-table td {
    padding: 0.55rem 0.65rem;
    vertical-align: middle;
    white-space: nowrap;
}

.stock-management-table thead th {
    color: #667085;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.stock-management-table thead th.stock-total-heading,
.stock-management-table thead th.stock-assigned-heading,
.stock-management-table thead th.stock-actions-heading,
.stock-management-table .stock-current-cell,
.stock-management-table td[data-label="Assigned"],
.stock-management-table td[data-label="Actions"] {
    text-align: center;
}

.stock-management-table .stock-total,
.stock-management-table .assigned-count,
.stock-management-table td[data-label="Assigned"] > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    height: 1.85rem;
    padding: 0 0.55rem;
    border-radius: 999px;
    background: #f1f4f8;
    color: var(--brand-blue);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1;
}

.stock-management-table .stock-total-button {
    border: 0;
    cursor: pointer;
}

.stock-management-table .stock-total-button:hover,
.stock-management-table .stock-total-button:focus {
    background: rgba(188, 171, 130, 0.2);
    color: var(--brand-blue);
}

.stock-management-table .row-actions {
    flex-direction: row;
    justify-content: center;
    gap: 0.7rem;
}

.stock-management-table .row-actions .btn-stock-action {
    width: 2.1rem;
    min-width: 2.1rem;
    height: 1.85rem;
    padding: 0;
}

@media (max-width: 640px) {
    .stock-table-responsive {
        overflow-x: auto;
    }

    .stock-management-table,
    .stock-management-table thead,
    .stock-management-table tbody,
    .stock-management-table tr,
    .stock-management-table th,
    .stock-management-table td {
        display: revert;
        width: auto;
    }

    .stock-management-table {
        min-width: 40rem;
        border-collapse: separate;
        border-spacing: 0;
    }

    .stock-management-table thead {
        display: table-header-group;
    }

    .stock-management-table tbody tr {
        display: table-row;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .stock-management-table th,
    .stock-management-table td {
        display: table-cell;
        width: auto;
        min-width: 0;
        height: auto;
        padding: 0.5rem 0.55rem;
        border-bottom: 1px solid var(--line);
        white-space: nowrap;
    }

    .stock-management-table td::before,
    .stock-management-table th::before {
        content: none !important;
        display: none !important;
    }

    .stock-management-table td[data-label="Size"] {
        color: var(--brand-blue);
        font-size: 0.9rem;
        font-weight: 500;
    }

    .stock-management-table td[data-label="Color"] {
        color: #344054;
        font-size: 0.9rem;
    }

    .stock-management-table .stock-current-cell,
        .stock-management-table td[data-label="Assigned"] {
        display: table-cell;
        padding: 0.5rem 0.55rem;
        border-radius: 0;
        background: transparent;
        text-align: center;
    }

    .stock-management-table .row-actions {
        display: flex;
        height: auto;
        align-items: center;
        justify-content: flex-start;
        padding-left: 0;
    }
}


/* Stock management tighter phone table */
@media (max-width: 640px) {
    .stock-management-table {
        min-width: 33.5rem;
    }

    .stock-management-table .stock-size-col { width: 5.4rem; }
    .stock-management-table .stock-color-col { width: 7.2rem; }
    .stock-management-table .stock-current-col { width: 6.3rem; }
    .stock-management-table .stock-assigned-col { width: 4.7rem; }
    .stock-management-table .stock-actions-col { width: 5.4rem; }

    .stock-management-table th,
    .stock-management-table td {
        padding-left: 0.42rem;
        padding-right: 0.42rem;
    }

    .stock-management-table thead th {
        font-size: 0.66rem;
    }

    .stock-management-table .stock-total,
    .stock-management-table .assigned-count,
    .stock-management-table td[data-label="Assigned"] > span {
        min-width: 1.85rem;
        height: 1.7rem;
        padding: 0 0.45rem;
        font-size: 0.82rem;
    }

    .stock-management-table .row-actions .btn-stock-action {
        width: 1.7rem;
        min-width: 1.7rem;
        height: 1.7rem;
    }

    .stock-management-table .row-actions {
        gap: 0.25rem;
    }
}


/* Stock management fit all columns on phones */
@media (max-width: 640px) {
    .stock-management-table {
        table-layout: fixed;
        width: 100%;
        min-width: 0;
    }

    .stock-management-table .stock-size-col { width: 13%; }
    .stock-management-table .stock-color-col { width: 22%; }
    .stock-management-table .stock-current-col { width: 14%; }
    .stock-management-table .stock-assigned-col { width: 14%; }
    .stock-management-table .stock-actions-col { width: 24%; }

    .stock-management-table th,
    .stock-management-table td {
        padding-left: 0.24rem;
        padding-right: 0.24rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .stock-management-table td[data-label="Size"],
    .stock-management-table td[data-label="Color"] {
        font-size: 0.78rem;
    }

    .stock-management-table thead th {
        font-size: 0.56rem;
        line-height: 1.1;
    }

    .stock-management-table .stock-total,
    .stock-management-table .assigned-count,
    .stock-management-table td[data-label="Assigned"] > span {
        min-width: 1.55rem;
        height: 1.55rem;
        padding: 0 0.35rem;
        font-size: 0.78rem;
    }

    .stock-management-table .row-actions .btn-stock-action {
        width: 1.55rem;
        min-width: 1.55rem;
        height: 1.55rem;
    }

    .stock-management-table .row-actions .btn-stock-action .bi {
        font-size: 0.78rem;
    }

    .stock-management-table .row-actions {
        gap: 0.18rem;
        justify-content: center;
    }
}


/* Stock management phone overflow guard */
@media (max-width: 640px) {
    body:has(.stock-management-table) {
        overflow-x: hidden;
    }

    body:has(.stock-management-table) .container,
    body:has(.stock-management-table) #stockList,
    body:has(.stock-management-table) .card,
    body:has(.stock-management-table) .card-body,
    body:has(.stock-management-table) .stock-table-responsive {
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .stock-management-table .stock-size-col { width: 12%; }
    .stock-management-table .stock-color-col { width: 18%; }
    .stock-management-table .stock-current-col { width: 12%; }
    .stock-management-table .stock-assigned-col { width: 13%; }
    .stock-management-table .stock-actions-col { width: 32%; }

    .stock-management-table th,
    .stock-management-table td {
        padding-left: 0.18rem;
        padding-right: 0.18rem;
    }

    .stock-management-table td[data-label="Color"] {
        font-size: 0.74rem;
    }

    .stock-management-table .row-actions .btn-stock-action {
        width: 1.45rem;
        min-width: 1.45rem;
        height: 1.45rem;
    }
}

/* Stock management single-line phone rows */
@media (max-width: 640px) {
    body:has(.stock-management-table) .container {
        width: 100vw;
        max-width: 100vw;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        box-sizing: border-box;
    }

    body:has(.stock-management-table) #stockList > .card {
        width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
        box-sizing: border-box;
    }

    body:has(.stock-management-table) .card-body {
        padding: 0.5rem 0.4rem;
    }

    body:has(.stock-management-table) .stock-table-responsive {
        width: 100%;
        overflow-x: hidden;
    }

    .stock-management-table {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: fixed;
    }

    .stock-management-table .stock-size-col { width: 24%; }
    .stock-management-table .stock-color-col { width: 27%; }
    .stock-management-table .stock-current-col { width: 12%; }
    .stock-management-table .stock-assigned-col { width: 12%; }
    .stock-management-table .stock-actions-col { width: 25%; }

    .stock-management-table th,
    .stock-management-table td {
        max-width: 0;
        padding: 0.44rem 0.22rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .stock-management-table thead th {
        font-size: 0.62rem;
        line-height: 1;
        text-align: left;
    }

    .stock-management-table thead th.stock-total-heading,
    .stock-management-table thead th.stock-assigned-heading {
        color: transparent;
        text-align: center;
    }

    .stock-management-table thead th.stock-total-heading::after,
    .stock-management-table thead th.stock-assigned-heading::after {
        color: #667085;
        display: block;
        font-size: 0.68rem;
        font-weight: 700;
    }

    .stock-management-table thead th.stock-total-heading::after { content: "S"; }
    .stock-management-table thead th.stock-assigned-heading::after { content: "A"; }

    .stock-management-table td[data-label="Size"],
    .stock-management-table td[data-label="Color"] {
        font-size: 0.84rem;
        line-height: 1.2;
        min-width: 0;
        max-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .stock-management-table .stock-current-cell,
        .stock-management-table td[data-label="Assigned"] {
        padding-left: 0.1rem;
        padding-right: 0.1rem;
        text-align: center;
    }

    .stock-management-table .stock-total,
    .stock-management-table .assigned-count,
    .stock-management-table td[data-label="Assigned"] > span {
        min-width: 1.65rem;
        height: 1.65rem;
        padding: 0 0.32rem;
        font-size: 0.84rem;
    }

    .stock-management-table .row-actions .btn-stock-action {
        width: 1.48rem;
        min-width: 1.48rem;
        height: 1.48rem;
    }

    .stock-management-table .row-actions .btn-stock-action .bi {
        font-size: 0.76rem;
    }

    .stock-management-table td[data-label="Actions"] {
        overflow: hidden;
        padding-left: 0.08rem;
        padding-right: 0.08rem;
        text-align: center;
    }

    .stock-management-table .row-actions {
        display: flex !important;
        width: max-content;
        max-width: 100%;
        gap: 0.12rem;
        justify-content: center !important;
        padding-left: 0;
        margin: 0 auto;
    }
}

/* Stock management five-column layout */
.stock-management-table .stock-size-col { width: 9rem; }
.stock-management-table .stock-color-col { width: 11rem; }
.stock-management-table .stock-current-col { width: 6rem; }
.stock-management-table .stock-assigned-col { width: 6rem; }
.stock-management-table .stock-actions-col { width: 6.5rem; }

.stock-management-table .stock-total-button {
    border: 0;
    cursor: pointer;
}

.stock-management-table .stock-total-button:hover,
.stock-management-table .stock-total-button:focus {
    background: rgba(188, 171, 130, 0.2);
    color: var(--brand-blue);
}

@media (max-width: 640px) {
    .stock-management-table .stock-size-col { width: 24%; }
    .stock-management-table .stock-color-col { width: 27%; }
    .stock-management-table .stock-current-col { width: 12%; }
    .stock-management-table .stock-assigned-col { width: 12%; }
    .stock-management-table .stock-actions-col { width: 25%; }

    .stock-management-table thead th.stock-total-heading,
    .stock-management-table thead th.stock-assigned-heading {
        color: transparent;
        text-align: center;
    }

    .stock-management-table thead th.stock-total-heading::after,
    .stock-management-table thead th.stock-assigned-heading::after {
        color: #667085;
        display: block;
        font-size: 0.68rem;
        font-weight: 700;
    }

    .stock-management-table thead th.stock-total-heading::after { content: "S"; }
    .stock-management-table thead th.stock-assigned-heading::after { content: "A"; }

    .stock-management-table .stock-current-cell,
    .stock-management-table td[data-label="Assigned"] {
        padding-left: 0.1rem;
        padding-right: 0.1rem;
        text-align: center;
    }
}

/* Stock management final mobile fit */
@media (max-width: 640px) {
    body:has(.stock-management-table) .stock-table-responsive {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
    }

    .stock-management-table {
        table-layout: fixed !important;
        width: 100% !important;
        min-width: 24rem !important;
        max-width: none !important;
    }

    .stock-management-table .stock-size-col { width: 25% !important; }
    .stock-management-table .stock-color-col { width: 28% !important; }
    .stock-management-table .stock-current-col { width: 12% !important; }
    .stock-management-table .stock-assigned-col { width: 12% !important; }
    .stock-management-table .stock-actions-col { width: 23% !important; }

    .stock-management-table th,
    .stock-management-table td {
        padding-left: 0.18rem !important;
        padding-right: 0.18rem !important;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .stock-management-table thead th.stock-actions-heading,
    .stock-management-table td[data-label="Actions"] {
        position: sticky !important;
        right: 0;
        z-index: 2;
        background: #fff;
        box-shadow: -8px 0 12px rgba(255, 255, 255, 0.92);
        text-align: center;
    }

    .stock-management-table thead th.stock-actions-heading {
        background: #f8fafc;
        font-size: 0.58rem;
    }

    .stock-management-table td[data-label="Actions"] {
        padding-left: 0.05rem !important;
        padding-right: 0.05rem !important;
    }

    .stock-management-table .row-actions {
        display: flex !important;
        width: 100%;
        gap: 0.55rem;
        justify-content: center !important;
        margin: 0;
    }

    .stock-management-table .row-actions .btn-stock-action {
        width: 1.65rem !important;
        min-width: 1.65rem !important;
        height: 1.65rem !important;
        flex: 0 0 1.65rem;
    }

    .stock-management-table .row-actions .btn-stock-action .bi {
        font-size: 0.74rem !important;
    }
}

/* User access cards override the stock-table mobile grid. */
@media (max-width: 768px) {
    .users-table tbody {
        display: block !important;
        padding: 0.65rem !important;
    }

    .users-table tbody tr {
        display: block !important;
        width: auto !important;
        margin: 0 0 0.75rem !important;
        padding: 0.45rem 0.75rem !important;
    }

    .users-table tbody tr:last-child {
        margin-bottom: 0 !important;
    }

    .users-table tbody td {
        display: flex !important;
        width: 100% !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 1rem !important;
        padding: 0.55rem 0 !important;
        text-align: right !important;
    }

    .users-table tbody td::before {
        display: block !important;
        flex: 0 0 5.5rem !important;
        content: attr(data-label) !important;
        text-align: left !important;
    }

    .users-table tbody td[data-label="Actions"] {
        display: flex !important;
        justify-content: flex-end !important;
        padding-top: 0.75rem !important;
    }
}

.dive-location-table td {
    font-size: 0.92rem;
}

.dive-location-table .btn,
.dive-item-table .btn {
    min-width: auto;
}

.dive-item-name {
    appearance: none;
    display: inline;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: 700;
    color: #042f66;
    text-align: left;
    cursor: pointer;
}

.dive-item-name:focus-visible {
    outline: 2px solid #042f66;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

.dive-item-tooltip {
    position: fixed;
    z-index: 1080;
    max-width: min(32rem, calc(100vw - 16px));
    max-height: calc(100dvh - 16px);
    overflow: auto;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.35rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    box-shadow: 0 3px 12px #0003;
    font-size: 0.875rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
    white-space: normal;
}

.dive-settings-page h1 {
    color: #042f66;
}

.dive-settings-workspace {
    display: flex;
    flex-direction: column;
}

.dive-settings-section-head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    margin-bottom: 0.85rem;
}

.dive-settings-section-head > h2 {
    line-height: 1.3;
}

.dive-settings-add {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
    width: 100%;
    min-width: 0;
    max-width: 28rem;
}

.dive-settings-add-fields {
    display: flex;
    flex: 1 1 auto;
    align-items: flex-end;
    gap: 0.4rem;
    min-width: 0;
}

.dive-settings-add-vessel {
    flex: 0 0 7.5rem;
    min-width: 7.5rem;
}

.dive-settings-add-vessel[hidden] {
    display: none !important;
}

.dive-settings-add-name {
    flex: 1 1 auto;
    min-width: 0;
}

.dive-settings-add .form-label {
    display: block;
    margin-bottom: 0.2rem;
    min-height: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1rem;
    color: #667085;
}

.dive-settings-add .form-select,
.dive-settings-add .form-control {
    box-sizing: border-box;
    height: 2.5rem;
    min-height: 2.5rem;
}

.dive-settings-add-btn {
    flex: 0 0 2.5rem;
    align-self: flex-end;
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.dive-settings-add-btn .bi {
    font-size: 1.1rem;
    line-height: 1;
}

.dive-location-group {
    margin-bottom: 0.25rem;
}

.dive-location-group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.2rem 0.15rem 0.45rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #667085;
}

.dive-location-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dive-location-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.35rem 0.65rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.7rem;
}

.dive-location-row.is-inactive {
    opacity: 0.72;
    background: #f8fafc;
}

.dive-location-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: #042f66;
}

button.dive-location-name {
    appearance: none;
    font: inherit;
    background: transparent;
    border: 0;
    padding: 0.15rem 0;
    min-height: 2.25rem;
    text-align: left;
    cursor: pointer;
}

button.dive-location-name:focus-visible {
    outline: 2px solid #042f66;
    outline-offset: 2px;
    border-radius: 0.35rem;
}

.dive-location-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
}

.dive-location-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    color: #98a2b3;
}

.dive-location-empty {
    padding: 0.75rem 0.15rem;
    color: #667085;
    font-size: 0.9rem;
}

@media (min-width: 992px) {
    .dive-settings-catalog {
        max-width: 32rem;
    }

    .dive-settings-page .dive-location-list {
        max-width: 28rem;
    }
}

@media (min-width: 1200px) {
    .dive-settings-workspace {
        display: grid;
        grid-template-columns: minmax(18rem, 32rem) minmax(0, 1fr);
        column-gap: 2.5rem;
        align-items: start;
    }

    .dive-settings-catalog {
        max-width: none;
        margin-bottom: 0;
    }

    .dive-settings-page .dive-location-list {
        max-width: 28rem;
    }
}

.dive-item-table {
    font-size: 0.9rem;
}

.dive-item-table thead th {
    white-space: nowrap;
}

.dive-item-table thead th.dive-sortable {
    cursor: pointer;
    user-select: none;
    overflow: visible;
}

.dive-item-table thead th.dive-sortable:hover,
.dive-item-table thead th.dive-sortable:focus-visible {
    color: var(--bs-primary);
}

.dive-item-table thead th.dive-sortable:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

.dive-item-table thead th.dive-sortable .sort-indicator {
    display: inline-block;
    min-width: 0.9em;
    margin-left: 0.35rem;
    font-size: 0.8em;
    line-height: 1;
    opacity: 0.9;
    color: var(--bs-primary);
}

@media (min-width: 641px) {
    .dive-page .dive-item-table {
        table-layout: fixed;
        width: 100%;
    }

    .dive-page .dive-item-table > :not(caption) > * > * {
        padding: 0.35rem 0.7rem;
        height: 3rem;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
    }



    .dive-page .dive-item-table .dive-col-name,
    .dive-page .dive-item-table .dive-col-brand,
    .dive-page .dive-item-table .dive-col-location,
    .dive-page .dive-item-table .dive-col-arrived,
    .dive-page .dive-item-table .dive-col-counted,
    .dive-page .dive-item-table .dive-col-revision {
        white-space: nowrap;
    }

    .dive-page .dive-item-table.dive-hide-brand .dive-col-brand,
    .dive-page .dive-item-table.dive-hide-location .dive-col-location,
    .dive-page .dive-item-table.dive-hide-status .dive-col-status,
    .dive-page .dive-item-table.dive-hide-arrived .dive-col-arrived,
    .dive-page .dive-item-table.dive-hide-counted .dive-col-counted,
    .dive-page .dive-item-table.dive-hide-revision .dive-col-revision,
    .dive-page .dive-item-table.dive-hide-qty .dive-col-qty {
        display: none;
        width: 0;
    }

    .dive-page .dive-item-table .dive-item-name {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dive-page .dive-item-table .dive-item-identity .dive-item-name {
        flex: 1 1 auto;
        min-width: 0;
    }

    .dive-page .dive-item-table .dive-item-copy .dive-item-name {
        display: block;
    }

    .dive-page .dive-item-table thead th.dive-col-qty,
    .dive-page .dive-item-table tbody td.dive-col-qty {
        padding-right: 1.6rem;
        text-align: right;
    }

    html:has(.dive-page),
    body:has(.dive-page) {
        height: 100%;
        overflow: hidden;
    }

    body:has(.dive-page) {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    body:has(.dive-page) > .navbar {
        flex: 0 0 auto;
    }

    .dive-page {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding-top: 0.45rem;
        padding-bottom: 0.4rem;
    }

    .dive-page .dive-workspace {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .dive-page .dive-toolbar {
        position: static;
        flex: 0 0 auto;
        z-index: 20;
        margin-bottom: 0.35rem;
        padding: 0 0.25rem 0.35rem;
    }

    .dive-page .dive-results {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .dive-page #diveMessage {
        flex: 0 0 auto;
    }

    .dive-page .table-responsive {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
    }

    .dive-page .dive-item-table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .dive-page .dive-item-table thead th {
        position: sticky;
        top: 0;
        z-index: 3;
        background: #fff;
        box-shadow: inset 0 -1px 0 #d9dee7;
    }

    .dive-page .dive-results > details {
        flex: 0 0 auto;
    }
}

.dive-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: 0 -0.25rem 0.65rem;
    padding: 0.35rem 0.25rem 0.55rem;
    background: transparent;
}

.dive-search-row {
    display: flex;
    gap: 0.45rem;
    align-items: stretch;
}

.dive-search-row > .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

.dive-item-count {
    flex: 0 0 auto;
    align-self: center;
    color: #667085;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.dive-search-row .form-control,
.dive-search-row .btn:not(#clearFilters):not(#addItemButton) {
    min-height: 2.6rem;
}

.dive-search-row #addItemButton {
    align-self: center;
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dive-column-picker {
    position: relative;
    flex: 0 0 auto;
    align-self: stretch;
    display: flex;
}

.dive-search-row #toggleColumns {
    width: 2.6rem;
    min-width: 2.6rem;
    padding-left: 0;
    padding-right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dive-column-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 30;
    min-width: 14.5rem;
    padding: 0.75rem 0.9rem 0.7rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.7rem;
    box-shadow: 0 10px 28px rgba(16, 24, 40, 0.12);
}

.dive-column-panel-title {
    margin: 0 0 0.45rem;
    color: #042f66;
    font-size: 0.82rem;
    font-weight: 600;
}

.dive-column-options {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.dive-column-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.22rem 0;
    color: #344054;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.dive-column-option input {
    margin: 0;
    flex: 0 0 auto;
}

.dive-column-option:has(input:disabled) {
    color: #667085;
    cursor: default;
}

.dive-column-show-all {
    margin-top: 0.45rem;
    color: #042f66;
    font-weight: 600;
    text-decoration: none;
}

.dive-filter-panel .form-select {
    min-height: 0;
    padding-top: 0.32rem;
    padding-bottom: 0.32rem;
    font-size: 0.86rem;
    font-weight: 400;
    line-height: 1.3;
}

.dive-filter-panel .form-select option {
    font-size: 0.86rem;
    font-weight: 400;
}

.dive-search-row #clearFilters {
    align-self: center;
    white-space: nowrap;
}

.dive-filter-options {
    max-height: 11.5rem;
    overflow: auto;
    padding: 0.3rem 0.55rem 0.4rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.6rem;
    background: #fff;
}

.dive-filter-option {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0;
    padding: 0.28rem 0;
    color: #1f2a37;
    font-size: 0.86rem;
    line-height: 1.3;
    cursor: pointer;
}

.dive-filter-option input {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.12rem;
}

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

.dive-filter-panel {
    margin-top: 0.65rem;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #fff;
}

.dive-filter-panel .form-label {
    margin-bottom: 0.2rem;
    color: #667085;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dive-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.dive-filter-chips:empty {
    display: none;
}

.dive-filter-chip {
    border: 1px solid rgba(4, 47, 102, 0.18);
    border-radius: 999px;
    background: rgba(4, 47, 102, 0.08);
    color: #042f66;
    font-size: 0.78rem;
    line-height: 1.2;
    padding: 0.25rem 0.6rem;
}

.dive-filter-group + .dive-filter-group {
    margin-top: 0.7rem;
}

.dive-filter-panel-head {
    display: none;
}

.dive-filter-panel-title {
    color: #042f66;
    font-size: 0.95rem;
    font-weight: 600;
}

@media (min-width: 992px) {
    .dive-page .dive-workspace {
        /* Keep related cells within a readable scanning distance on wide monitors. */
        width: 100%;
        max-width: 105.9rem;
        display: grid;
        grid-template-columns: 17rem minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        grid-template-areas:
            "filters tools"
            "filters results";
        column-gap: 0.9rem;
        align-items: stretch;
    }

    .dive-page .dive-filter-panel,
    .dive-page .dive-filter-panel.d-none {
        grid-area: filters;
        display: flex !important;
        flex-direction: column;
        min-width: 0;
        min-height: 0;
        height: auto;
        margin-top: 0.1rem;
        margin-bottom: 0.15rem;
        overflow: hidden;
    }

    .dive-page .dive-toolbar {
        grid-area: tools;
        margin: 0 0 0.35rem;
        padding: 0 0 0.35rem;
        background: transparent;
    }

    .dive-page .dive-results {
        grid-area: results;
        background: var(--surface);
    }

    .dive-page #toggleFilters {
        display: none;
    }

    .dive-page .dive-filter-panel-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex: 0 0 auto;
        margin-bottom: 0.55rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #e5e7eb;
    }

    .dive-page .dive-filter-panel-head .btn {
        display: none;
    }

    .dive-page .dive-filter-panel-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
        padding-right: 0.1rem;
    }

    .dive-page .dive-filter-options {
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 991.98px) {
    body[data-module="dive"] {
        overflow-x: hidden;
        overscroll-behavior-x: none;
    }

    .dive-page {
        overflow-x: hidden;
        touch-action: pan-y pinch-zoom;
        overscroll-behavior-x: none;
    }

    .dive-toolbar,
    .dive-workspace {
        max-width: 100%;
        overflow-x: hidden;
    }

    body.dive-filters-open {
        overflow: hidden;
        overscroll-behavior: none;
        overscroll-behavior-x: none;
        touch-action: pan-y pinch-zoom;
    }

    body.dive-filters-open .dive-workspace {
        position: fixed;
        top: var(--dive-nav-bottom, 3.5rem);
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1025;
        display: flex;
        flex-direction: column;
        margin: 0;
        padding: 0.5rem 0.85rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
        overflow: hidden;
        overflow-x: hidden;
        touch-action: pan-y pinch-zoom;
        overscroll-behavior-x: none;
        background: var(--page-bg);
    }

    body.dive-filters-open .dive-toolbar {
        position: static;
        flex: 0 0 auto;
        z-index: auto;
        margin: 0;
        padding: 0;
        max-width: 100%;
        overflow-x: hidden;
        background: transparent;
    }

    body.dive-filters-open .dive-search-row,
    body.dive-filters-open .dive-item-count,
    body.dive-filters-open .dive-filter-chips {
        flex: 0 0 auto;
        max-width: 100%;
        min-width: 0;
    }

    body.dive-filters-open .dive-filter-panel {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-width: 0;
        min-height: 0;
        margin-top: 0.5rem;
        overflow: hidden;
        overflow-x: hidden;
    }

    body.dive-filters-open .dive-filter-panel-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        flex: 0 0 auto;
        min-width: 0;
        margin-bottom: 0.55rem;
        padding-bottom: 0.55rem;
        border-bottom: 1px solid #e5e7eb;
    }

    body.dive-filters-open .dive-filter-panel-head .btn {
        min-height: 2.6rem;
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }

    body.dive-filters-open .dive-filter-panel-body {
        flex: 1 1 auto;
        min-width: 0;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        overscroll-behavior-x: none;
        touch-action: pan-y pinch-zoom;
        padding-right: 0.15rem;
    }

    body.dive-filters-open .dive-filter-options {
        max-height: none;
        max-width: 100%;
        overflow: visible;
    }

    body.dive-filters-open .dive-results {
        display: none;
    }
}

@media (max-width: 640px) {
    .dive-column-picker {
        display: none !important;
    }

    .dive-page .form-control,
    .dive-page .form-select,
    .dive-search-row .btn,
    .dive-filter-option {
        font-size: 16px;
    }

    body.dive-filters-open .dive-workspace {
        background: #fff;
    }

    .dive-page .table-responsive {
        overflow-x: hidden !important;
        overflow-y: visible !important;
        max-width: 100%;
    }

    .dive-page .dive-item-table thead {
        display: none !important;
    }

    .dive-page .dive-item-table,
    .dive-page .dive-item-table tbody {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .dive-page .dive-item-table colgroup,
    .dive-page .dive-item-table col {
        display: none !important;
    }

    .dive-page .dive-item-table tbody tr.dive-item-row {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-areas:
            "name qty" !important;
        align-items: start !important;
        gap: 0.12rem 0.6rem !important;
        width: auto !important;
        margin: 0 0 0.4rem !important;
        padding: 0.65rem 0.7rem !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 0.7rem !important;
        background: #fff !important;
        cursor: default;
    }

    .dive-page .dive-item-table tbody tr.dive-item-row::after {
        content: none !important;
        display: none !important;
    }

    .dive-page .dive-item-table td {
        display: block !important;
        width: auto !important;
        min-width: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dive-page .dive-item-table td::before {
        content: none !important;
        display: none !important;
    }

    .dive-page .dive-item-table .dive-col-name {
        grid-area: name;
        color: #042f66;
        font-size: 0.95rem;
        font-weight: 600;
        white-space: normal;
        overflow: visible;
    }

    .dive-item-identity {
        align-items: center;
        gap: calc(0.3rem + 2px);
        width: 100%;
    }

    .dive-item-copy {
        display: flex;
        flex-direction: column;
        gap: 0.12rem;
        min-width: 0;
    }

    .dive-item-title-full {
        display: none;
    }

    .dive-item-title-short {
        display: inline;
    }

    .dive-item-name {
        display: block;
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-height: 0;
        padding: 0;
        line-height: 1.25;
    }

    .dive-item-extra {
        display: block;
        margin: 0;
        color: #667085;
        font-size: 0.78rem;
        font-weight: 400;
        line-height: 1.3;
        white-space: normal;
    }

    .dive-page .dive-item-table .dive-col-qty {
        grid-area: qty;
        color: #042f66;
        font-size: 0.9rem;
        font-weight: 700;
        text-align: right !important;
    }

    .dive-page .dive-item-table .dive-col-brand,
    .dive-page .dive-item-table .dive-col-location,
    .dive-page .dive-item-table .dive-col-status,
    .dive-page .dive-item-table .dive-col-arrived,
    .dive-page .dive-item-table .dive-col-counted,
    .dive-page .dive-item-table .dive-col-revision {
        display: none !important;
    }

    .dive-page .dive-item-table .dive-empty-row td {
        border: 0 !important;
        padding: 1.5rem 0.5rem !important;
        text-align: center;
        white-space: normal;
    }

    .dive-settings-page .form-control,
    .dive-settings-page .form-select,
    #renameLocationModal .form-control {
        font-size: 16px;
    }

    .dive-settings-add {
        max-width: none;
        width: 100%;
    }

    .dive-settings-add-btn {
        flex-basis: 2.75rem;
        min-width: 2.75rem;
        width: 2.75rem;
        height: 2.75rem;
        min-height: 2.75rem;
    }

    .dive-settings-add .form-select,
    .dive-settings-add .form-control {
        height: 2.75rem;
        min-height: 2.75rem;
    }

    .dive-location-row .btn-stock-action {
        min-width: 2.25rem;
        height: 2.25rem;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

.stock-take-page .stock-take-main {
    max-width: 40rem;
    margin: 0 auto;
    padding-bottom: 5.5rem;
}

.stock-take-page-head {
    margin-bottom: 1.25rem;
}

.stock-take-title {
    margin: 0;
    color: var(--brand-blue);
    font-size: 1.65rem;
    font-weight: 600;
    line-height: 1.2;
}

.stock-take-title-session {
    font-size: 1.2rem;
}

.stock-take-lede {
    margin: 0.4rem 0 0;
    color: #667085;
    font-size: 0.9rem;
    line-height: 1.45;
}

.stock-take-section-label {
    margin: 0 0 0.55rem;
    color: var(--brand-blue);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stock-take-vessel-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.stock-take-vessel-row .btn {
    width: 100%;
}

.stock-take-resume:focus-visible,
.stock-take-location:focus-visible,
.stock-take-chip:focus-visible,
.stock-take-result:focus-visible,
.stock-take-ghost:focus-visible,
.stock-take-danger:focus-visible {
    outline: 2px solid var(--brand-blue);
    outline-offset: 2px;
}

.stock-take-choice-list {
    display: grid;
    gap: 0.55rem;
}

.stock-take-page .btn-stock-action {
    height: auto;
    min-height: 2.6rem;
    min-width: 0;
    padding: 0.55rem 1.15rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
}

.stock-take-page .btn-stock-action.btn-sm {
    min-height: 2rem;
    padding: 0.3rem 0.9rem;
    font-size: 0.82rem;
}

.stock-take-resume,
.stock-take-location,
.stock-take-chip,
.stock-take-result,
.stock-take-ghost,
.stock-take-danger {
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.stock-take-ghost {
    height: auto;
    min-height: 2.6rem;
    padding: 0.55rem 1.15rem;
    border: 1px solid var(--brand-gold);
    border-radius: 999px;
    background: #fff;
    color: var(--brand-blue);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
}

.stock-take-ghost:hover,
.stock-take-ghost:focus {
    background: rgba(188, 171, 130, 0.18);
    border-color: var(--brand-gold);
    color: var(--brand-blue);
}

.stock-take-resume,
.stock-take-location {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin: 0 0 0.55rem;
    padding: 0.95rem 1.05rem;
    border: 1px solid rgba(4, 47, 102, 0.08);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    color: var(--brand-blue);
    text-align: left;
}

.stock-take-location {
    margin: 0;
    font-weight: 600;
    justify-content: flex-start;
    text-align: left;
}

.stock-take-resume:last-child {
    margin-bottom: 0;
}

.stock-take-resume:hover,
.stock-take-resume:focus,
.stock-take-location:hover,
.stock-take-location:focus {
    border-color: rgba(188, 171, 130, 0.7);
    box-shadow: 0 0.6rem 1.8rem rgba(4, 47, 102, 0.12);
    color: var(--brand-blue);
}

.stock-take-resume-title {
    color: var(--brand-blue);
    font-size: 0.98rem;
    font-weight: 600;
}

.stock-take-resume-meta {
    margin-top: 0.2rem;
    color: #667085;
    font-size: 0.8rem;
    font-weight: 400;
}

.stock-take-session-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.stock-take-progress {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
    color: #667085;
    font-size: 0.85rem;
}

.stock-take-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    height: 1.55rem;
    padding: 0 0.5rem;
    border-radius: 999px;
    background: #f1f4f8;
    color: var(--brand-blue);
    font-size: 0.78rem;
    font-weight: 700;
}

.stock-take-categories {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.stock-take-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2rem;
    padding: 0.28rem 0.75rem;
    border: 1px solid var(--brand-gold);
    border-radius: 999px;
    background: #fff;
    color: var(--brand-blue);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.stock-take-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.7rem;
    padding: 0.08rem 0.4rem;
    border-radius: 999px;
    background: #f1f4f8;
    color: var(--brand-blue);
    font-size: 0.72rem;
    font-weight: 700;
}

.stock-take-chip.is-active {
    background: var(--brand-gold);
    border-color: var(--brand-gold);
    color: #fff;
}

.stock-take-chip.is-active .stock-take-chip-count {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.stock-take-chip:hover,
.stock-take-chip:focus {
    border-color: var(--brand-gold);
    color: var(--brand-blue);
}

.stock-take-chip.is-active:hover,
.stock-take-chip.is-active:focus {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: var(--brand-gold);
}

.stock-take-card {
    background: #fff;
    border: 1px solid rgba(4, 47, 102, 0.08);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    padding: 0.95rem 1.05rem;
    margin-bottom: 0.75rem;
}

.stock-take-card.is-checked {
    border-color: rgba(188, 171, 130, 0.7);
}

.stock-take-card.is-missing {
    border-color: #c0392b;
}

.dive-item-identity {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
    max-width: 100%;
}

.dive-item-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.dive-item-extra,
.dive-item-title-short {
    display: none;
}

@media (max-width: 640px) {
    .dive-item-identity {
        align-items: center;
        gap: calc(0.3rem + 2px);
        width: 100%;
    }

    .dive-item-copy {
        display: flex;
        flex-direction: column;
        gap: 0.12rem;
        min-width: 0;
    }

    .dive-item-title-full {
        display: none;
    }

    .dive-item-title-short {
        display: inline;
    }

    .dive-item-name {
        display: block;
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-height: 0;
        padding: 0;
        line-height: 1.25;
    }

    .dive-item-extra {
        display: block;
        margin: 0;
        color: #667085;
        font-size: 0.78rem;
        font-weight: 400;
        line-height: 1.3;
        white-space: normal;
    }
}

.dive-page .dive-item-photo-btn {
    flex: 0 0 auto;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 0.95rem;
    height: 0.95rem;
    min-width: 0.95rem;
    min-height: 0.95rem;
    max-width: 0.95rem;
    max-height: 0.95rem;
    padding: 0;
    line-height: 1;
    font-size: 0.45rem;
}

.dive-page .dive-item-photo-btn .bi,
.dive-page .dive-item-photo-btn .bi::before {
    display: block;
    width: 0.45rem;
    height: 0.45rem;
    font-size: 0.45rem;
    line-height: 1;
    vertical-align: 0;
}

.dive-item-photo-frame {
    display: block;
    width: 100%;
    margin: 0 0 0.5rem;
    padding: 0;
    border: 1px solid #d9e2ec;
    border-radius: 0.55rem;
    background: #f8fafc;
    cursor: zoom-in;
}

.dive-item-photo-frame:focus-visible {
    outline: 2px solid #042f66;
    outline-offset: 2px;
}

.dive-item-photo {
    display: block;
    width: 100%;
    max-height: 16rem;
    height: auto;
    object-fit: contain;
    background: #f8fafc;
}

.dive-item-photo-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.dive-item-photo-actions .form-control {
    flex: 1 1 12rem;
}

.stock-take-photo {
    width: 4.5rem;
    height: 4.5rem;
    object-fit: cover;
    border-radius: 0.45rem;
    border: 1px solid #d9e2ec;
    background: #f8fafc;
}

.dive-photo-viewer {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.88);
}

.dive-photo-viewer-image {
    display: block;
    max-width: min(96vw, 56rem);
    max-height: calc(100vh - 5.5rem);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.4rem;
    background: #0f172a;
}

.dive-photo-viewer-caption {
    margin: 0;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
}

.dive-photo-viewer-close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.dive-photo-viewer-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.stock-take-card.is-issue {
    border-color: var(--brand-gold);
}

.stock-take-item-head {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.7rem;
}

.stock-take-item-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.stock-take-item-title {
    margin: 0 0 0.2rem;
    color: var(--brand-blue);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.stock-take-item-copy .stock-take-item-meta {
    margin-bottom: 0;
}

.stock-take-item-meta {
    margin: 0 0 0.65rem;
    color: #667085;
    font-size: 0.82rem;
}

.stock-take-qty-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.7rem;
}

.stock-take-qty-label {
    color: #667085;
    font-size: 0.82rem;
}

.stock-take-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
}

.stock-take-result {
    min-height: 2.5rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--brand-gold);
    border-radius: 999px;
    background: #fff;
    color: var(--brand-blue);
    font-size: 0.86rem;
    font-weight: 600;
}

.stock-take-result:hover,
.stock-take-result:focus {
    border-color: var(--brand-gold);
    background: rgba(188, 171, 130, 0.14);
    color: var(--brand-blue);
}

.stock-take-result.is-active {
    background: var(--brand-gold);
    border-color: var(--brand-gold);
    color: #fff;
}

.stock-take-result.is-active[data-result="missing"] {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

.stock-take-result.is-active[data-result="issue"] {
    background: #8c7850;
    border-color: #8c7850;
    color: #fff;
}

.stock-take-qty {
    max-width: 6rem;
    border-radius: 999px;
    text-align: center;
}

.stock-take-footer {
    position: sticky;
    bottom: 0;
    padding: 0.75rem 0 1rem;
    background: linear-gradient(transparent, var(--page-bg) 30%);
}

.stock-take-review-card {
    margin-bottom: 1rem;
}

.stock-take-review-summary {
    margin: 0 0 0.7rem;
    color: #667085;
    font-size: 0.9rem;
}

.stock-take-review-row {
    padding: 0.45rem 0;
    border-top: 1px solid var(--line);
    color: var(--ink);
    font-size: 0.9rem;
}

.stock-take-review-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.stock-take-review-empty {
    color: #667085;
    font-size: 0.9rem;
}

.stock-take-review-actions {
    display: grid;
    gap: 0.55rem;
}

.stock-take-danger {
    min-height: 2.6rem;
    padding: 0.55rem 1.15rem;
    border: 1px solid rgba(192, 57, 43, 0.35);
    border-radius: 999px;
    background: #fff;
    color: #c0392b;
    font-size: 0.9rem;
    font-weight: 600;
}

.stock-take-danger:hover,
.stock-take-danger:focus {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

.stock-take-done-card {
    padding: 1.25rem 1.15rem 1.35rem;
}

.stock-take-page .pwa-install-banner .btn-primary {
    background: var(--brand-gold);
    border-color: var(--brand-gold);
    border-radius: 999px;
    color: #fff;
}

.stock-take-page .pwa-install-banner .btn-primary:hover,
.stock-take-page .pwa-install-banner .btn-primary:focus {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: var(--brand-gold);
}

@media (max-width: 770px) {
    .stock-take-page .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    .stock-take-page .btn-stock-action {
        height: auto;
        min-height: 2.6rem;
        min-width: 0;
        padding: 0.55rem 1.15rem;
        font-size: 0.95rem;
    }

    .stock-take-page .btn-stock-action.btn-sm {
        min-height: 2rem;
        padding: 0.3rem 0.9rem;
        font-size: 0.82rem;
    }
}

@media (max-width: 640px) {
    .stock-take-page .navbar-module {
        display: none !important;
    }

    .stock-take-title {
        font-size: 1.35rem;
    }

    .stock-take-title-session {
        font-size: 1.1rem;
    }

    .stock-take-card,
    .stock-take-resume,
    .stock-take-location {
        border-radius: 12px;
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    }

    .stock-take-footer {
        background: linear-gradient(transparent, #fff 30%);
    }
}

.pwa-install-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(4, 47, 102, 0.16);
    border-radius: 0.85rem;
    background: #fff;
    color: #344054;
    font-size: 0.9rem;
    line-height: 1.35;
}

.login-page .pwa-install-banner {
    margin-bottom: 1.25rem;
    background: #f6f8fb;
}

.pwa-install-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.pwa-standalone .pwa-install-banner {
    display: none !important;
}

/* Theme toggle */
.inventory-theme-host {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: auto;
}

.inventory-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #fff;
    line-height: 1;
}

.inventory-theme-toggle:hover,
.inventory-theme-toggle:focus {
    color: #bcab82;
}

.inventory-theme-toggle:focus-visible {
    outline: 2px solid #bcab82;
    outline-offset: 2px;
}

.inventory-theme-icon {
    display: inline-flex;
}

.inventory-theme-toggle .inventory-theme-icon-sun {
    display: none;
}

.inventory-theme-toggle.is-dark .inventory-theme-icon-moon {
    display: none;
}

.inventory-theme-toggle.is-dark .inventory-theme-icon-sun {
    display: inline-flex;
}

.inventory-theme-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.inventory-theme-toggle-login {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    width: auto;
    min-height: 2.4rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(2, 31, 67, 0.35);
    color: #fff;
    backdrop-filter: blur(6px);
}

.inventory-theme-toggle-login:hover,
.inventory-theme-toggle-login:focus {
    color: #bcab82;
    border-color: rgba(188, 171, 130, 0.7);
    background: rgba(2, 31, 67, 0.55);
}

.login-shell {
    position: relative;
}

/* Dark mode — surfaces, text, and interactive states */
[data-bs-theme="dark"] body {
    background: var(--page-bg);
    color: var(--ink);
}

[data-bs-theme="dark"] .login-page {
    background:
        radial-gradient(circle at 12% 12%, rgba(188, 171, 130, 0.18), transparent 32%),
        linear-gradient(145deg, #010b1a 0%, #021f43 55%, #06365f 100%);
}

[data-bs-theme="dark"] .login-card {
    background: rgba(27, 36, 51, 0.96);
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.5);
    color: var(--ink);
}

[data-bs-theme="dark"] .login-brand h1 {
    color: var(--brand-blue);
}

[data-bs-theme="dark"] .login-eyebrow {
    color: var(--brand-gold);
}

[data-bs-theme="dark"] .login-card .btn-primary,
[data-bs-theme="dark"] .access-card + .btn-primary {
    background: #0c4f88;
    border-color: #0c4f88;
    color: #fff;
}

[data-bs-theme="dark"] .login-card .btn-primary:hover,
[data-bs-theme="dark"] .login-card .btn-primary:focus,
[data-bs-theme="dark"] .access-card + .btn-primary:hover,
[data-bs-theme="dark"] .access-card + .btn-primary:focus {
    background: #1563a8;
    border-color: #1563a8;
    color: #fff;
}

[data-bs-theme="dark"] .navbar {
    background-color: #042F66 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .module-card,
[data-bs-theme="dark"] .access-card,
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .uniform-section,
[data-bs-theme="dark"] .permission-option,
[data-bs-theme="dark"] .custom-dropdown-menu,
[data-bs-theme="dark"] .custom-dropdown-item,
[data-bs-theme="dark"] .pwa-install-banner,
[data-bs-theme="dark"] .login-page .pwa-install-banner,
[data-bs-theme="dark"] .stock-take-resume,
[data-bs-theme="dark"] .stock-take-location,
[data-bs-theme="dark"] .stock-take-ghost,
[data-bs-theme="dark"] .stock-take-result,
[data-bs-theme="dark"] .stock-take-danger,
[data-bs-theme="dark"] .stock-take-chip,
[data-bs-theme="dark"] .inventory-bell-menu {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line);
    box-shadow: 0 10px 24px var(--shadow);
}

[data-bs-theme="dark"] .module-card:hover,
[data-bs-theme="dark"] .module-card:focus {
    color: var(--ink);
    box-shadow: 0 0.6rem 1.8rem rgba(158, 197, 234, 0.18);
}

[data-bs-theme="dark"] .permission-option:has(input:checked) {
    border-color: #5f84ad;
    background: var(--hover-surface);
}

[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer,
[data-bs-theme="dark"] .section-header,
[data-bs-theme="dark"] .uniform-table th,
[data-bs-theme="dark"] .table th,
[data-bs-theme="dark"] .location-total {
    background: var(--table-head) !important;
    border-color: var(--line) !important;
    color: var(--brand-blue);
}

[data-bs-theme="dark"] .card-header h5,
[data-bs-theme="dark"] .dive-settings-page h1,
[data-bs-theme="dark"] .dive-item-name,
[data-bs-theme="dark"] .dive-location-name,
[data-bs-theme="dark"] .stock-take-title,
[data-bs-theme="dark"] .stock-take-section-label,
[data-bs-theme="dark"] .inventory-bell-head,
[data-bs-theme="dark"] .inventory-bell-item,
[data-bs-theme="dark"] #clearStockFilters {
    color: var(--brand-blue) !important;
}

[data-bs-theme="dark"] .inventory-bell-item:hover,
[data-bs-theme="dark"] .inventory-bell-item:focus,
[data-bs-theme="dark"] .custom-dropdown-item:hover,
[data-bs-theme="dark"] .custom-dropdown-item.active,
[data-bs-theme="dark"] .table-hover tbody tr:hover,
[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
    background: var(--hover-surface) !important;
    color: var(--ink);
}

[data-bs-theme="dark"] .inventory-bell-item.is-read {
    color: var(--muted-text);
}

[data-bs-theme="dark"] .table,
[data-bs-theme="dark"] .table td,
[data-bs-theme="dark"] .table th {
    color: var(--ink);
    border-color: var(--line);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .stock-take-qty {
    background-color: #141c29;
    border-color: #3a4a60;
    color: var(--ink);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .stock-take-qty:focus {
    background-color: #141c29;
    border-color: var(--brand-blue);
    color: var(--ink);
    box-shadow: 0 0 0 0.18rem var(--focus-ring);
}

[data-bs-theme="dark"] .form-control::placeholder,
[data-bs-theme="dark"] .form-select::placeholder {
    color: #7f91a6;
}

[data-bs-theme="dark"] .form-text,
[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .stock-match-count,
[data-bs-theme="dark"] .stock-take-lede,
[data-bs-theme="dark"] .stock-take-qty-label,
[data-bs-theme="dark"] .stock-take-review-summary,
[data-bs-theme="dark"] .stock-take-review-empty,
[data-bs-theme="dark"] .history-meta,
[data-bs-theme="dark"] .dive-item-meta,
[data-bs-theme="dark"] .dive-location-meta {
    color: var(--muted-text) !important;
}

[data-bs-theme="dark"] .btn-stock-action {
    background-color: #BCAB82;
    border-color: #BCAB82;
    color: #042F66;
}

[data-bs-theme="dark"] .btn-stock-action:hover,
[data-bs-theme="dark"] .btn-stock-action:focus,
[data-bs-theme="dark"] .btn-stock-action.btn-outline-primary:hover,
[data-bs-theme="dark"] .btn-stock-action.btn-outline-danger:hover {
    background-color: #0c4f88;
    border-color: #0c4f88;
    color: #d4c49a;
}

[data-bs-theme="dark"] .add-uniform-btn,
[data-bs-theme="dark"] .update-stock-link {
    color: var(--brand-gold);
}

[data-bs-theme="dark"] .add-uniform-btn:hover,
[data-bs-theme="dark"] .update-stock-link:hover {
    color: #fff;
}

[data-bs-theme="dark"] .delete-link,
[data-bs-theme="dark"] .delete-link:hover {
    color: var(--danger);
}

[data-bs-theme="dark"] .assigned-count:hover,
[data-bs-theme="dark"] .assigned-count:focus,
[data-bs-theme="dark"] .location-chip:hover,
[data-bs-theme="dark"] .location-chip:focus,
[data-bs-theme="dark"] .history-sort-button:hover,
[data-bs-theme="dark"] .history-sort-button:focus,
[data-bs-theme="dark"] .stock-management-table .stock-total-button:hover,
[data-bs-theme="dark"] .stock-management-table .stock-total-button:focus {
    color: var(--brand-blue);
    background: var(--hover-surface);
}

[data-bs-theme="dark"] .location-chip {
    background: var(--chip-bg);
    border-color: var(--line);
    color: var(--brand-gold);
}

[data-bs-theme="dark"] .location-chip:hover,
[data-bs-theme="dark"] .location-chip:focus {
    background: var(--brand-gold);
    color: #042F66;
}

[data-bs-theme="dark"] .stock-take-ghost:hover,
[data-bs-theme="dark"] .stock-take-ghost:focus,
[data-bs-theme="dark"] .stock-take-resume:hover,
[data-bs-theme="dark"] .stock-take-resume:focus,
[data-bs-theme="dark"] .stock-take-location:hover,
[data-bs-theme="dark"] .stock-take-location:focus,
[data-bs-theme="dark"] .stock-take-chip:hover,
[data-bs-theme="dark"] .stock-take-chip:focus,
[data-bs-theme="dark"] .stock-take-result:hover,
[data-bs-theme="dark"] .stock-take-result:focus {
    background: rgba(212, 196, 154, 0.16);
    border-color: var(--brand-gold);
    color: var(--brand-blue);
}

[data-bs-theme="dark"] .stock-take-chip.is-active,
[data-bs-theme="dark"] .stock-take-result.is-active {
    background: var(--brand-gold);
    border-color: var(--brand-gold);
    color: #042F66;
}

[data-bs-theme="dark"] .stock-take-chip.is-active:hover,
[data-bs-theme="dark"] .stock-take-chip.is-active:focus {
    background: #0c4f88;
    border-color: #0c4f88;
    color: var(--brand-gold);
}

[data-bs-theme="dark"] .stock-take-result.is-active[data-result="missing"],
[data-bs-theme="dark"] .stock-take-danger:hover,
[data-bs-theme="dark"] .stock-take-danger:focus {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

[data-bs-theme="dark"] .stock-take-result.is-active[data-result="issue"] {
    background: #8c7850;
    border-color: #8c7850;
    color: #fff;
}

[data-bs-theme="dark"] .stock-take-danger {
    background: var(--surface);
    border-color: rgba(240, 113, 103, 0.45);
    color: var(--danger);
}

[data-bs-theme="dark"] .stock-take-footer {
    background: linear-gradient(transparent, var(--page-bg) 30%);
}

[data-bs-theme="dark"] .stock-take-page .pwa-install-banner .btn-primary {
    background: var(--brand-gold);
    border-color: var(--brand-gold);
    color: #042F66;
}

[data-bs-theme="dark"] .stock-take-page .pwa-install-banner .btn-primary:hover,
[data-bs-theme="dark"] .stock-take-page .pwa-install-banner .btn-primary:focus {
    background: #0c4f88;
    border-color: #0c4f88;
    color: var(--brand-gold);
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: var(--surface);
    border-color: var(--line);
    color: var(--ink);
}

[data-bs-theme="dark"] .dropdown-item {
    color: var(--ink);
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus,
[data-bs-theme="dark"] .dropdown-item.active,
[data-bs-theme="dark"] .dropdown-item:active {
    background-color: var(--hover-surface);
    color: var(--ink);
}

[data-bs-theme="dark"] .modal-content {
    background-color: var(--surface);
    color: var(--ink);
    border-color: var(--line);
}

[data-bs-theme="dark"] .modal-body,
[data-bs-theme="dark"] .list-group-item {
    background-color: var(--surface);
    color: var(--ink);
    border-color: var(--line);
}

[data-bs-theme="dark"] .alert {
    border-color: var(--line);
}

[data-bs-theme="dark"] .alert-info {
    background-color: #1a334d;
    color: #c5dff5;
    border-color: #2d5273;
}

[data-bs-theme="dark"] .alert-danger {
    background-color: #3a1f24;
    color: #f5c2c0;
    border-color: #6b3434;
}

[data-bs-theme="dark"] .alert-success {
    background-color: #1d3a2a;
    color: #b7e0c5;
    border-color: #2f5a40;
}

[data-bs-theme="dark"] .alert-warning {
    background-color: #3a3018;
    color: #f0dfb0;
    border-color: #6a5630;
}

[data-bs-theme="dark"] .btn-outline-light {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.55);
}

[data-bs-theme="dark"] .btn-outline-light:hover,
[data-bs-theme="dark"] .btn-outline-light:focus {
    color: #042F66;
    background-color: #bcab82;
    border-color: #bcab82;
}

[data-bs-theme="dark"] .btn-link {
    color: var(--brand-blue);
}

[data-bs-theme="dark"] .btn-link:hover,
[data-bs-theme="dark"] .btn-link:focus {
    color: var(--brand-gold);
}

[data-bs-theme="dark"] .dive-item-name:focus-visible,
[data-bs-theme="dark"] button.dive-location-name:focus-visible,
[data-bs-theme="dark"] .stock-take-resume:focus-visible,
[data-bs-theme="dark"] .stock-take-location:focus-visible,
[data-bs-theme="dark"] .stock-take-chip:focus-visible,
[data-bs-theme="dark"] .stock-take-result:focus-visible,
[data-bs-theme="dark"] .stock-take-ghost:focus-visible,
[data-bs-theme="dark"] .stock-take-danger:focus-visible,
[data-bs-theme="dark"] .dive-item-photo-frame:focus-visible,
[data-bs-theme="dark"] .dive-photo-viewer-close:focus-visible {
    outline-color: var(--brand-blue);
}

[data-bs-theme="dark"] .dive-search-row > .form-control,
[data-bs-theme="dark"] .dive-filter-rail,
[data-bs-theme="dark"] .dive-phone-card,
[data-bs-theme="dark"] .dive-item-sheet,
[data-bs-theme="dark"] .users-card,
[data-bs-theme="dark"] .history-card,
[data-bs-theme="dark"] .stock-filter-bar .form-control,
[data-bs-theme="dark"] .stock-filter-bar .form-select {
    background-color: var(--surface);
    border-color: var(--line);
    color: var(--ink);
}

[data-bs-theme="dark"] .badge.bg-light,
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-white {
    background-color: var(--chip-bg) !important;
    color: var(--ink) !important;
}

[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-end {
    border-color: var(--line) !important;
}

[data-bs-theme="dark"] .text-dark {
    color: var(--ink) !important;
}

[data-bs-theme="dark"] .text-primary {
    color: var(--brand-blue) !important;
}

[data-bs-theme="dark"] .text-secondary {
    color: var(--muted-text) !important;
}

[data-bs-theme="dark"] .text-danger {
    color: var(--danger) !important;
}

[data-bs-theme="dark"] hr {
    border-color: var(--line);
    opacity: 1;
}

@media (max-width: 640px) {
    [data-bs-theme="dark"] .stock-take-footer {
        background: linear-gradient(transparent, var(--page-bg) 30%);
    }

    [data-bs-theme="dark"] .stock-take-card,
    [data-bs-theme="dark"] .stock-take-resume,
    [data-bs-theme="dark"] .stock-take-location {
        box-shadow: 0 6px 16px var(--shadow);
    }
}

[data-bs-theme="dark"] .dive-location-row,
[data-bs-theme="dark"] .dive-column-panel,
[data-bs-theme="dark"] .dive-filter-options,
[data-bs-theme="dark"] .dive-filter-panel,
[data-bs-theme="dark"] .dive-item-photo-frame,
[data-bs-theme="dark"] .dive-item-photo,
[data-bs-theme="dark"] .stock-take-photo,
[data-bs-theme="dark"] .stock-take-card,
[data-bs-theme="dark"] .stock-take-done-card,
[data-bs-theme="dark"] .stock-take-review-card,
[data-bs-theme="dark"] .history-entry,
[data-bs-theme="dark"] .users-account-card {
    background: var(--surface) !important;
    border-color: var(--line) !important;
    color: var(--ink);
}

[data-bs-theme="dark"] .dive-location-row.is-inactive {
    background: var(--chip-bg) !important;
}

[data-bs-theme="dark"] .dive-page .dive-item-table thead th {
    background: var(--surface) !important;
    box-shadow: inset 0 -1px 0 var(--line);
    color: var(--brand-blue);
}

[data-bs-theme="dark"] .dive-column-panel-title,
[data-bs-theme="dark"] .dive-column-show-all,
[data-bs-theme="dark"] .dive-filter-panel-title,
[data-bs-theme="dark"] .dive-filter-chip,
[data-bs-theme="dark"] .dive-location-name,
[data-bs-theme="dark"] button.dive-location-name {
    color: var(--brand-blue) !important;
}

[data-bs-theme="dark"] .dive-column-option,
[data-bs-theme="dark"] .dive-filter-option {
    color: var(--ink);
}

[data-bs-theme="dark"] .dive-column-option:has(input:disabled),
[data-bs-theme="dark"] .dive-location-group-head,
[data-bs-theme="dark"] .dive-item-count,
[data-bs-theme="dark"] .dive-filter-panel .form-label {
    color: var(--muted-text) !important;
}

[data-bs-theme="dark"] .dive-filter-chip {
    background: rgba(158, 197, 234, 0.14);
    border-color: rgba(158, 197, 234, 0.35);
}

[data-bs-theme="dark"] .dive-page .dive-filter-panel-head {
    border-bottom-color: var(--line);
}

[data-bs-theme="dark"] .stock-total,
[data-bs-theme="dark"] .vessel-pill,
[data-bs-theme="dark"] .location-total {
    background: var(--chip-bg);
    border-color: var(--line);
    color: var(--brand-blue);
}

[data-bs-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%);
    opacity: 0.75;
}

[data-bs-theme="dark"] .btn-close:hover {
    opacity: 1;
}

@media (max-width: 991.98px) {
    [data-bs-theme="dark"] body.dive-filters-open .dive-workspace {
        background: var(--page-bg) !important;
    }

    [data-bs-theme="dark"] .dive-page .dive-item-table tbody tr.dive-item-row {
        background: var(--surface) !important;
        border-color: var(--line) !important;
    }

    [data-bs-theme="dark"] .dive-page .dive-item-table .dive-col-name {
        color: var(--brand-blue);
    }
}

@media (max-width: 768px) {
    [data-bs-theme="dark"] .table td,
    [data-bs-theme="dark"] .users-table tbody td,
    [data-bs-theme="dark"] .history-table tbody td {
        background: var(--surface);
        border-color: var(--line);
        color: var(--ink);
    }
}

/* Preserve compact assignment cards with both operation actors. */
@media (max-width: 640px) {
    .assignment-history-table .history-status-cell {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .assignment-history-table td.history-actor-cell {
        display: block;
        justify-self: stretch;
        max-width: none;
        overflow-wrap: anywhere;
        padding-top: 0.45rem;
        border-top: 1px solid var(--line);
    }
    .assignment-history-table td[data-label="Returned by"] { grid-area: returnedby; }
    .assignment-history-table td.history-actor-cell::before {
        content: attr(data-label) !important;
        display: block !important;
        color: var(--bs-secondary-color);
        font-size: 0.72rem;
        font-weight: 500;
        text-transform: uppercase;
    }
}

/* Grouped desktop identity; phone cards keep their existing compact summary. */
.dive-item-variant,
.dive-cell-primary,
.dive-cell-secondary {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}
.dive-item-variant,
.dive-cell-secondary {
    color: var(--bs-secondary-color);
    font-size: 0.78rem;
    font-weight: 400;
}
.dive-cell-primary { font-weight: 500; }
.dive-cell-lines { display: block; min-width: 0; }
.dive-col-revision .dive-cell-secondary { color: inherit; }
@media (min-width: 641px) {
    .dive-page .dive-item-table thead th { height: 2.1rem; }
    .dive-item-title-full {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.3;
    }
}
@media (max-width: 640px) {
    .dive-item-variant { display: none; }
}

/* Vessel stock is visible alongside the total on desktop only. */
.stock-management-table .stock-vessel-col { width: 5rem; }
.stock-management-table .stock-vessel-cell { text-align: center; }
@media (max-width: 767.98px) {
    .stock-management-table .stock-vessel-col,
    .stock-management-table .stock-vessel-cell { display: none !important; }
}

/* Semantic grouped headers and restrained quantity hierarchy. */
.stock-management-table .stock-mobile-head { display: none; }
@media (max-width: 767.98px) {
    .stock-management-table .stock-desktop-head { display: none !important; }
    .stock-management-table .stock-mobile-head { display: table-row; }
}
@media (min-width: 768px) {
    .stock-management-table { table-layout: fixed; }
    .stock-management-table .stock-size-col { width: 22%; }
    .stock-management-table .stock-color-col { width: auto; }
    .stock-management-table .stock-vessel-col,
    .stock-management-table .stock-current-col { width: 4.5rem; }
    .stock-management-table .stock-assigned-col,
    .stock-management-table .stock-actions-col { width: 8rem; }
    .stock-management-table .stock-group-heading {
        text-align: center;
        padding: 0.35rem 0.65rem 0.2rem;
        border-bottom: 0;
        color: var(--bs-body-color);
        text-transform: none;
        font-size: 0.75rem;
    }
    .stock-management-table .stock-subhead th {
        padding-top: 0.2rem;
        padding-bottom: 0.4rem;
    }
    .stock-management-table .stock-vessel-cell,
    .stock-management-table .stock-current-cell,
    .stock-management-table .stock-total-heading { text-align: center; }
    .stock-management-table .stock-available-cols {
        background-color: rgba(4, 47, 102, 0.025);
    }
    .stock-management-table .stock-vessel-cell .stock-total,
    .stock-management-table .stock-current-cell .stock-total {
        min-width: 0;
        height: auto;
        padding: 0;
        border-radius: 0;
        background: transparent;
        color: var(--bs-body-color);
        font-variant-numeric: tabular-nums;
        font-weight: 400;
    }
    .stock-management-table .stock-current-cell,
    .stock-management-table .stock-total-heading {
        border-left: 1px solid var(--bs-border-color);
    }
    .stock-management-table .stock-current-cell .stock-total-button {
        font-weight: 700;
        color: var(--brand-blue);
        text-decoration: underline;
        text-decoration-color: rgba(4, 47, 102, 0.3);
        text-underline-offset: 0.2em;
        padding: 0.35rem;
        margin: 0;
        border-radius: 0.25rem;
    }
    .stock-management-table .stock-current-cell .stock-total-button:hover {
        background: rgba(188, 171, 130, 0.2);
        text-decoration-color: currentColor;
    }
    .stock-management-table .stock-current-cell .stock-total-button:focus-visible {
        outline: 2px solid currentColor;
        outline-offset: 2px;
    }
    .stock-management-table td[data-label="Color"],
    .stock-management-table td[data-label="Size"] {
        overflow: hidden;
        text-overflow: ellipsis;
    }
    [data-bs-theme="dark"] .stock-management-table .stock-available-cols {
        background-color: rgba(150, 185, 225, 0.06);
    }
    [data-bs-theme="dark"] .stock-management-table .stock-current-cell .stock-total-button {
        color: #a8caff;
        text-decoration-color: currentColor;
    }
}

@media (min-width: 768px) {
    .stock-management-table thead th.stock-total-heading { text-align: center; }
    .stock-management-table .stock-group-heading,
    .stock-management-table .stock-vessel-cell,
    .stock-management-table .stock-current-cell,
    .stock-management-table .stock-total-heading { background-color: rgba(4, 47, 102, 0.025); }
    [data-bs-theme="dark"] .stock-management-table .stock-group-heading,
    [data-bs-theme="dark"] .stock-management-table .stock-vessel-cell,
    [data-bs-theme="dark"] .stock-management-table .stock-current-cell,
    [data-bs-theme="dark"] .stock-management-table .stock-total-heading { background-color: rgba(150, 185, 225, 0.06); }
}

/* Assignment results always separate identity from source/availability. */
#customUniformDropdown .custom-dropdown-item {
    padding: 10px 12px;
    white-space: normal;
    overflow-wrap: anywhere;
}
.uniform-option-title,
.uniform-option-details {
    display: block;
    line-height: 1.35;
}
.uniform-option-title {
    font-weight: 500;
}
.uniform-option-details {
    margin-top: 3px;
    font-size: 0.8em;
}
