:root {
    --main-color: #2ecc71;
    --main-color-light: #27ae60;
    --main-color-lighter: #7ee9ae;
    --main-color-dark: #229954;
    --main-color-darker: #1e8449;
    --text-primary: #1f2937;
    --text-muted: #6b7280;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border-color: #e5e7eb;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 14px 34px rgba(15, 23, 42, 0.12);
    --transition-fast: 150ms ease;
    --transition-base: 220ms ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow: auto;
    background: radial-gradient(circle at top right, #f0fff7 0%, #f8fafc 35%, #f5f7fa 100%);
    color: var(--text-primary);
}

html, body, main {
    height: calc(100vh - 70px);
    font-weight: 300 !important;
    overflow: hidden;
}

main {
    position: relative;
}

#page-info > h1 {
    color: var(--main-color);
    font-weight: 300 !important;
    font-size: 2rem !important;
    letter-spacing: 0.04em;
}

#page-info > p {
    opacity: 0.8;
    color: var(--text-muted);
}

p,
.text-muted,
small {
    color: var(--text-muted) !important;
}

.navbar-brand { margin-left: 20px; }

#mobile-topbar-actions {
    margin-left: 0.5rem;
    margin-right: auto;
}

#mobile-topbar-actions-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#mobile-topbar-actions-content .btn,
#mobile-topbar-actions-content a.btn {
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    line-height: 1.1;
    white-space: nowrap;
}

#mobile-topbar-actions-content .btn svg,
#mobile-topbar-actions-content a.btn svg {
    width: 16px;
    height: 16px;
}

#mobile-topbar-actions-content .btn .text,
#mobile-topbar-actions-content a.btn .text {
    display: inline-block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

#content-container {
    height: 100%;
    overflow-y: auto;
    padding-top: 1.25rem;
    padding-bottom: 150px !important;
}

#content-container::-webkit-scrollbar {
    width: 10px;
}

#content-container::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

a, a.default {
    text-decoration: none;
    color: var(--main-color);
    transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover, a.default:hover {
    color: var(--main-color-light);
}

a:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.page-link:focus-visible,
.dropdown-item:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.25) !important;
}

.hidden {
    display: none !important;
}

.text-main-color {
    color: var(--main-color);
}

.fixed-text-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.partial-text-wrapper {
    position: relative;
    transition: max-height 0.3s ease-out;
    max-height: 220px;
    overflow: hidden;
}

.partial-text-wrapper.expanded {
    max-height: 4000px;
    transition: max-height 0.6s ease-in;
}

.partial-text {
    margin-bottom: 0;
}

.navbar {
    position: relative;
    z-index: 1060;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
    box-shadow: var(--shadow-sm);
}

header {
    position: relative;
    z-index: 9;
}

.navbar .dropdown-menu {
    z-index: 1070;
}

.monogram-logo {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    border-radius: 50%;
    background-color: var(--main-color);
    color: #fff;
    text-align: center;
    font-size: 18px;
    text-transform: capitalize;
    font-weight: 400;
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.28);
}

#btn-add-new {
    display: block;
    position: fixed;
    top: auto;
    bottom: 50px;
    left: auto;
    right: 50px;
    background-color: var(--main-color);
    color: #fff;
    font-weight: 600;
    font-size: 28px;
    width: 50px;
    height: 50px;
    text-align: center;
    line-height: 50px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-base), background-color var(--transition-base), box-shadow var(--transition-base);
}

#btn-add-new:hover {
    background-color: var(--main-color-light);
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(39, 174, 96, 0.35);
}

.card {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.card:hover {
    border-color: #d1d5db;
    box-shadow: var(--shadow-md);
}

.card .card-header,
.card .card-footer {
    background-color: transparent;
    border-color: var(--border-color);
}

.card-title {
    color: var(--main-color);
    font-weight: 300 !important;
    letter-spacing: 0.01em;
}

.alert-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 99999;
    width: 100%;
    max-width: 300px;
}

.alert {
    border-radius: var(--radius-md);
    border-width: 1px;
    box-shadow: var(--shadow-sm);
}

.shadow-sm {
    --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
    --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
    box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}

/* Bootstrap overrides */
.btn {
    border-radius: 10px;
    font-weight: 500;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-no-border {
    border-width: 0;
}

.active>.page-link, .page-link.active {
    border: 1px solid var(--main-color);
}

.btn-primary, .active>.page-link, .page-link.active {
    background-color: var(--main-color);
    border-color: var(--main-color);
    color: #fff;
}

.btn-outline-primary {
    color: var(--main-color);
    border-color: var(--main-color);
    background-color: transparent;
}

.btn-light {
    background-color: #f3f4f6;
    border-color: #f3f4f6;
    color: #374151;
}

.btn-light:hover {
    background-color: #e5e7eb;
    border-color: #e5e7eb;
    color: #111827;
}

.btn-primary:hover, .btn-outline-primary:hover, .btn-secondary:hover {
    background-color: var(--main-color-light);
    border-color: var(--main-color-light);
    color: #fff;
}
.btn:disabled.btn-primary, .btn:disabled.btn-primary:hover {
    background-color: var(--main-color-lighter);
    border-color: var(--main-color-lighter);
    cursor: not-allowed;
}
.btn:disabled.btn-outline-primary, .btn:disabled.btn-outline-primary:hover {
    color: var(--main-color-lighter);
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #eceff3;
    border-color: #eceff3;
    color: #424242;
}

.btn:disabled.btn-primary, .btn:disabled.btn-primary:hover {
    color: #858585;
    cursor: not-allowed;
}

.form-control,
.form-select,
.input-group-text {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    background-color: #fff;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control::placeholder {
    color: #9ca3af;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.16);
}

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    border-bottom-color: #edf0f4;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    vertical-align: middle;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(46, 204, 113, 0.06);
    color: inherit;
}

.badge {
    font-weight: 500;
    border-radius: 999px;
    padding: 0.38rem 0.62rem;
}

.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 0.35rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--main-color-darker);
}

.page-link {
    color: var(--main-color-dark);
    border-radius: 8px;
    border-color: var(--border-color);
    margin: 0 2px;
}

.page-link:hover {
    color: #fff;
    background-color: var(--main-color-light);
    border-color: var(--main-color-light);
}

.pagination-modern-wrap {
    width: 100%;
}

.pagination.pagination-modern {
    gap: 6px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.pagination.pagination-modern .page-item .page-link {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: #334155;
    font-weight: 500;
    padding: 0 12px;
    transition: all var(--transition-fast);
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.03);
}

.pagination.pagination-modern .page-item:not(.disabled):not(.active) .page-link:hover {
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.38);
    color: var(--main-color-darker);
}

.pagination.pagination-modern .page-item.active .page-link,
.pagination.pagination-modern .active > .page-link {
    background: var(--main-color);
    border-color: var(--main-color);
    color: #fff;
    box-shadow: 0 6px 14px rgba(46, 204, 113, 0.3);
}

@media (min-width: 768px) {
    .items-list-pagination-wrap .pagination.pagination-modern {
        justify-content: center !important;
    }
}

.pagination.pagination-modern .page-item.disabled .page-link {
    color: #94a3b8;
    background: #f8fafc;
    border-color: #e5e7eb;
    opacity: 1;
}

.modal-content {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

hr {
    opacity: 1;
    border-top: 1px solid #edf0f4;
}

.catalog-icon {
    width: 50px;
}
.catalog-icon svg {
    width: 100%;
    height: auto;
    color: var(--main-color);
}

#sidebar {
    background-color: #ffffff;
    border-right: 1px solid var(--border-color);
}

#sidebar .nav-link {
    text-decoration: none;
    color: var(--main-color-dark);
    border-radius: 10px;
    font-weight: 300 !important;
    transition: all var(--transition-fast);
}

#sidebar .nav-link:hover {
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--main-color-darker);
}

#sidebar .nav-link.active,
#sidebar .nav-link[aria-current="page"] {
    background-color: rgba(46, 204, 113, 0.14);
    color: var(--main-color-darker);
    font-weight: 500 !important;
}

/* History page (mobile-first) */
.history-actions {
    width: 100%;
}

.history-actions .btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.history-list {
    position: relative;
    display: grid;
    gap: 10px;
}

.history-list::before {
    content: "";
    position: absolute;
    left: 21px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background-color: #d9e2ec;
}

.history-entry {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
    gap: 0;
}

.history-line-node-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    padding-top: 10px;
    z-index: 1;
}

.history-line-node {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    color: #fff;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    border: 2px solid #fff;
}

.history-card {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.history-card .card-body {
    padding: 14px;
}

.history-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.history-actor {
    display: flex;
    align-items: flex-start;
}

.history-meta {
    min-width: 0;
}

.history-user,
.history-date {
    display: flex;
    align-items: center;
    gap: 2px;
    word-break: break-word;
}

.history-user {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 2px;
}

.history-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.history-badge-wrap {
    width: 100%;
}

.history-badge {
    background-color: rgba(46, 204, 113, 0.12) !important;
    color: var(--main-color-darker);
    border: 1px solid rgba(46, 204, 113, 0.25);
    width: 100%;
    text-align: left;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 10px;
    white-space: normal;
}

.history-changes {
    border-top: 1px solid #edf0f4;
    padding-top: 10px;
}

.history-change-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
}

.history-change-list li {
    background-color: var(--surface-soft);
    border: 1px solid #edf0f4;
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    display: grid;
    grid-template-columns: minmax(90px, 26%) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.history-field {
    display: inline-block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0;
    font-size: 0.82rem;
    line-height: 1.1;
    text-transform: capitalize;
}

.history-change-values {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.history-old,
.history-new {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.78rem;
    line-height: 1.2;
    padding: 2px 7px;
    border: 1px solid transparent;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.history-old {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.history-new {
    background-color: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.history-arrow {
    color: #9ca3af;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Items */
.processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}
.processing-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}
.item-card-wrapper {
    position: relative;
}

/* Mobile-first item card cleanup */
.mobile-item-image {
    height: 170px;
    object-fit: cover;
}

.mobile-item-title {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.25;
}

.mobile-item-title a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
}

.mobile-title-edit-icon {
    width: 14px;
    height: 14px;
    opacity: 0.75;
    flex-shrink: 0;
}

.mobile-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.35rem;
}

.mobile-item-kpis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.mobile-kpi {
    border: 1px solid #edf0f4;
    background-color: #f8fafc;
    border-radius: 10px;
    padding: 8px;
}

.mobile-kpi-label {
    display: block;
    font-size: 0.72rem;
    color: #6b7280;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mobile-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 12px;
}

.mobile-icon-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    flex: 0 0 48px;
    padding: 0;
    position: relative;
    border-radius: 10px;
}

.mobile-icon-btn i,
.mobile-icon-btn svg {
    width: 40px;
    height: 40px;
}

.mobile-icon-btn .comment-count-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    font-size: 0.68rem;
    line-height: 1;
    padding: 0.25rem 0.35rem;
}

.mobile-icon-btn.btn-outline-secondary.text-warning {
    border-color: #f4d98f;
}

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

.items-stats-card {
    border-radius: var(--radius-md);
    border: 1px solid #e9eef5;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.items-stats-card .card-body {
    padding: 14px;
}

.items-stats-card-desktop .card-body {
    display: flex;
    align-items: center;
    gap: 12px;
}

.items-stats-content {
    min-width: 0;
}

.items-stats-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(46, 204, 113, 0.12);
    color: var(--main-color-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.items-stats-icon {
    width: 20px;
    height: 20px;
    color: var(--main-color-dark);
}

.items-stats-label {
    margin: 0;
    color: #64748b !important;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.items-stats-value {
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}

.items-stats-link {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.82rem;
    font-weight: 500;
}

.items-stats-grid-mobile .items-stats-card-mobile .card-body {
    text-align: center;
    padding: 12px 8px;
}

.items-stats-grid-mobile .items-stats-icon-wrap {
    margin: 0 auto 8px auto;
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.items-stats-grid-mobile .items-stats-icon {
    width: 18px;
    height: 18px;
}

.items-stats-grid-mobile .items-stats-label {
    font-size: 0.7rem;
}

.items-stats-grid-mobile .items-stats-value {
    font-size: 1rem;
}

#items-alert {
    position: fixed;
    top: 84px;
    right: 16px;
    left: auto;
    z-index: 1085;
    width: auto;
    max-width: min(420px, calc(100vw - 32px));
    margin: 0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
    border-radius: 12px;
}

@media screen and (max-width: 767px) {
    #items-alert {
        top: 70px;
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        border-radius: 0;
    }
}

/* Mobile page actions FAB (Google Paper style) */
#mobile-page-actions {
    position: fixed;
    right: 16px;
    bottom: 20px;
    z-index: 1100;
}

#mobile-page-actions-hint {
    position: absolute;
    right: 64px;
    bottom: 10px;
    background: #ffffff;
    color: #334155;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1;
    padding: 7px 10px;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    pointer-events: none;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

#mobile-page-actions-fab {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background-color: var(--main-color);
    color: #fff;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.32);
    transition: transform var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
    animation: mobile-fab-pulse 2.2s infinite;
}

@keyframes mobile-fab-pulse {
    0%, 100% {
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.32), 0 0 0 0 rgba(46, 204, 113, 0.38);
    }
    60% {
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.32), 0 0 0 12px rgba(46, 204, 113, 0);
    }
}

#mobile-page-actions-fab:hover {
    background-color: var(--main-color-light);
}

#mobile-page-actions.is-open #mobile-page-actions-fab {
    transform: rotate(45deg);
    animation: none;
}

#mobile-page-actions.is-open #mobile-page-actions-hint {
    opacity: 0;
    transform: translateY(6px);
}

#mobile-page-actions-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.24);
    backdrop-filter: blur(1px);
}

#mobile-page-actions-menu {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: min(320px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 10px;
}

#mobile-page-actions-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#mobile-page-actions-content .btn,
#mobile-page-actions-content a.btn {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    padding: 10px 12px;
}

#mobile-page-actions-content .btn-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#mobile-page-actions-content .dropdown,
#mobile-page-actions-content .dropdown > .btn {
    width: 100%;
}

#mobile-page-actions-content .text-end {
    text-align: left !important;
}

@media screen and (min-width: 768px) {
    /* history */
    .history-actions {
        width: auto;
    }

    .history-actions .btn {
        width: auto;
        justify-content: center;
    }

    .history-card .card-body {
        padding: 18px;
    }

    .history-line-node-wrap {
        padding-top: 12px;
    }

    .history-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }

    .history-badge-wrap {
        width: auto;
        max-width: 48%;
    }

    .history-badge {
        width: auto;
        text-align: left;
    }

    .history-change-list li {
        padding: 7px 10px;
        grid-template-columns: minmax(120px, 22%) minmax(0, 1fr);
    }

    /* Items */
    .mobile-item-image {
        height: 180px;
    }

    .items-stats-grid {
        gap: 14px;
    }

    .items-stats-card .card-body {
        padding: 16px;
    }

    .items-stats-value {
        font-size: 1.25rem;
    }
}

@media screen and (max-width: 768px) {
    /* Make mobile scrolling natural (avoid scroll traps). */
    html, body {
        height: auto !important;
        overflow: auto !important;
    }

    main {
        height: auto !important;
        overflow: visible !important;
    }

    /* Content padding tuned for small screens and thumb use. */
    #content-container {
        height: auto !important;
        overflow: visible !important;
        padding: 1rem !important;
        padding-bottom: 120px !important;
    }

    /* Larger touch targets (minimum 44px). */
    .btn,
    .form-control,
    .form-select,
    .dropdown-item,
    .nav-link {
        min-height: 44px;
    }

    /* Prevent iOS zoom-on-focus by keeping input font-size >= 16px. */
    .form-control,
    .form-select,
    .input-group-text,
    .btn {
        font-size: 16px;
    }

    .btn {
        padding: 10px 14px;
    }

    /* Make btn-sm still usable on mobile. */
    .btn.btn-sm {
        font-size: 16px;
        padding: 10px 14px;
    }

    .card {
        border-radius: 10px;
        box-shadow: var(--shadow-sm);
    }

    .dropdown-menu .dropdown-item {
        padding: 12px 14px;
    }

    /* Alerts should not cover too much screen on mobile. */
    .alert-container {
        left: 12px;
        right: 12px;
        top: 70px;
        max-width: none;
    }

    /* Floating add button: slightly larger and closer to thumb reach. */
    #btn-add-new {
        bottom: 24px;
        right: 16px;
        width: 56px;
        height: 56px;
        line-height: 56px;
        font-size: 30px;
    }

    /* Page actions should wrap cleanly on mobile instead of shrinking text. */
    #page-actions {
        display: none;
    }

    #page-actions > div {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: flex-start;
        margin-bottom: 20px;
    }

    #page-actions svg {
        width: 20px;
        height: 20px;
    }

    /* Icon-only buttons (three-dots etc.) */
    .btn-icon-touch {
        width: 44px;
        height: 44px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
    }

    .table-responsive {
        border-radius: var(--radius-md);
        border: 1px solid var(--border-color);
        background-color: #fff;
    }

    .pagination.pagination-modern {
        justify-content: center;
    }

    .items-stats-grid {
        gap: 8px;
    }

    .items-stats-grid-mobile .items-stats-card-mobile .card-body {
        padding: 10px 6px;
    }

    .items-stats-grid-mobile .items-stats-icon-wrap {
        width: 34px;
        height: 34px;
        margin-bottom: 6px;
    }

    .items-stats-grid-mobile .items-stats-value {
        font-size: 0.95rem;
    }

    #mobile-page-actions {
        right: 16px;
        bottom: 20px;
    }

    #mobile-page-actions-hint {
        right: 62px;
        bottom: 8px;
    }

    #mobile-topbar-actions {
        display: flex;
        flex-direction: row;
        justify-content: start;
        align-items: center;
        margin-left: 5px;
        margin-right: auto;
    }

    #mobile-topbar-actions-content .btn,
    #mobile-topbar-actions-content a.btn {
        min-height: 34px;
        padding: 5px;
        font-size: 1.2rem;
    }

    #mobile-topbar-actions-content .btn .text,
    #mobile-topbar-actions-content a.btn .text {
        max-width: 90px;
    }
}

/* ============================================================
   Comments modal (items_list.html)
   ============================================================ */
#item-comments-modal {
    z-index: 1200;
}

.comments-modal-backdrop {
    z-index: 1195;
}

/* ============================================================
   Form fieldsets (item_detail.html, item_create.html)
   ============================================================ */
fieldset {
    margin-bottom: 2rem;
}

/* ============================================================
   Catalog form processing overlay (catalog_form.html)
   Note: .processing-overlay and .item-card-wrapper are already
   defined in the main CSS above from inline_styles.html.
   This variant uses inset shorthand and bs-body-bg-rgb.
   ============================================================ */
.catalog-form-processing-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--bs-body-bg-rgb), 0.75);
    z-index: 10;
    cursor: progress;
}

/* ============================================================
   Export spreadsheet table (export_catalogs.html, export_items.html)
   ============================================================ */
.export-page-wrapper .container {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

.spreadsheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}
.spreadsheet-table thead th {
    background: #f8f9fa;
    border: 1px solid #d0d5dd;
    padding: 6px 10px;
    font-weight: 600;
    font-size: 12px;
    color: #344054;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    user-select: none;
}
.spreadsheet-table tbody td {
    background: #fff;
    border: 1px solid #e4e7ec;
    padding: 5px 10px;
    color: #1d2939;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.spreadsheet-table tbody tr:hover td {
    background: #f0f4ff;
}

.col-resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    z-index: 1;
}
.col-resize-handle:hover,
.col-resize-handle.resizing {
    background: #4a7cff;
}
