:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --bg-main: #f8fafc;
    --sidebar-bg: rgba(255, 255, 255, 0.85);
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text-main: #1e293b;
    --text-dim: #64748b;
    --radius: 20px;
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --portal-top-height: 4.375rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --primary-hover: #4f46e5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

@media screen and (max-width: 2000px) {
    html { font-size: 15px; }
}

@media screen and (max-width: 1600px) {
    html { font-size: 14px; }
}

@media screen and (max-width: 1400px) {
    html { font-size: 13px; }
}

@media screen and (max-width: 1200px) {
    html { font-size: 12px; }
}

html, body {
    min-height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    background: var(--bg-light);
}

/* Global Table Centering Force-Multiplier */
.batch-table th, .batch-table td {
    text-align: center !important;
    vertical-align: middle !important;
}
.batch-table th:nth-child(3), .batch-table td:nth-child(3), .name-cell {
    text-align: left !important;
}

/* --- MASTER LAYOUT & SIDEBAR --- */
.sidebar-layout {
    display: flex;
    height: 100dvh !important;
    width: 100%;
    background: var(--bg-main);
    position: relative;
    overflow: hidden;
}

.sidebar {
    width: 17.5rem !important;
    min-width: 17.5rem !important;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    height: 100%;
}

/* Sidebar Collapsed State (Desktop) */
@media (min-width: 1025px) {
    .sidebar.collapsed {
        width: 0 !important;
        min-width: 0 !important;
        border-right: none;
        overflow: hidden;
    }
}

.sidebar-header {
    padding: 1.5rem;
    height: var(--portal-top-height);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.sidebar nav {
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    overflow: visible;
}

.nav-btn .icon {
    font-size: 1.25rem;
    width: 24px;
    display: flex;
    justify-content: center;
    opacity: 0.7;
}

.nav-btn:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
}

.nav-btn.active {
    background: var(--primary) !important;
    color: white !important;
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.4);
}

.nav-btn.active .icon {
    opacity: 1;
    filter: brightness(0) invert(1);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover { 
    background: rgba(99, 102, 241, 0.1); 
    color: var(--primary);
}

.nav-btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background: #f1f5f9;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.nav-btn.small:hover:not(:disabled) { background: #e2e8f0; }
.nav-btn.small:disabled { opacity: 0.5; cursor: not-allowed; }

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    height: 100%;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

#offers-view, #dashboard-view, #products-view, #requests-list-view, #management-view, #general-settings-view, .batch-detail-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    overflow: hidden;
}

.view > .card.glass {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

header {
    height: 60px;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: none;
    margin: 0 0 1rem 0;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-only {
    display: flex;
}

header h1 {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.view {
    padding: 1.5rem 2rem 1rem 2rem !important;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

.table-wrapper {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.table-scroll-area {
    flex: 1;
    overflow: auto !important;
}

.btn-primary, .primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}


.table-controls {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0.5rem 0.25rem;
}

.search-input {
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    padding: 0.85rem 1.25rem !important;
    border-radius: 12px !important;
    font-size: 0.95rem !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02) !important;
    transition: all 0.2s ease !important;
    width: 100%;
}

.search-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1) !important;
}

.filter-group {
    background: #ffffff !important;
    padding: 0.4rem 1.25rem !important;
    border-radius: 12px !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02) !important;
}

.mapping-row label {
    font-weight: 500;
    color: var(--text-dim);
}

.mapping-row .search-input {
    width: 100%;
    padding: 0.8rem 1.2rem;
    padding-left: 3rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.search-input:focus {
}

.btn-primary, .primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}


.table-controls {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0.5rem 0.25rem;
}

.search-input {
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    padding: 0.85rem 1.25rem !important;
    border-radius: 12px !important;
    font-size: 0.95rem !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02) !important;
    transition: all 0.2s ease !important;
    width: 100%;
}

.search-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1) !important;
}

.filter-group {
    background: #ffffff !important;
    padding: 0.4rem 1.25rem !important;
    border-radius: 12px !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02) !important;
}

.mapping-row label {
    font-weight: 500;
    color: var(--text-dim);
}

.mapping-row .search-input {
    width: 100%;
    padding: 0.8rem 1.2rem;
    padding-left: 3rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: #fff;
}

.card.glass {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    padding-bottom: 1rem !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    flex: 0 0 auto;
    max-height: calc(100vh - 110px);
    min-height: 0;
    overflow-y: auto; /* Leidžia slinkti, jei turinio daug (pvz. Requests) */
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

.pagination {
    background: var(--card-bg);
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.img-placeholder, .product-img {
    width: 36px !important;
    height: 36px !important;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
}

.direct-input {
    height: 28px !important;
    margin: 0 !important;
    padding: 2px 6px !important;
}

/* --- STAT CARDS PREMIUM --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1.75rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.stat-card p {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    letter-spacing: -0.02em;
}

.img-cell, .img-cell {
    position: relative;
    cursor: zoom-in;
}

.product-img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: transform 0.2s;
    display: inline-block;
}

#global-image-preview {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
    display: none;
    background: white;
    padding: 6px;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 2px solid white;
    max-width: 450px;
}

#global-image-preview img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    object-fit: contain;
}

thead th {
    z-index: 20;
    background: #f8fafc;
}

.product-img:hover {
    z-index: 9999 !important;
}

.table-action-group {
    display: flex;
    gap: 0.5rem;
    min-height: 32px;
    align-items: center;
}

#mapping-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.mapping-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.mapping-row label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.mapping-row select {
    width: 100%;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    font-size: 0.95rem;
    color: var(--text-main);
}

.search-input, #status-filter {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: var(--text-main);
    font-size: 0.95rem;
}

.search-input { flex: 1; }

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding-top: 1.5rem;
    margin-top: auto;
}

.upload-zone, .upload-area {
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-zone:hover, .upload-area:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.primary-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }

.batch-content .table-wrapper {
    width: 100%;
    min-width: max-content;
    max-height: none;
    overflow: visible;
    margin: 0;
    border: none;
    border-radius: 0;
    position: relative;
    background: white;
}

.table-scroll-area {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    position: relative;
    border-radius: 0 0 12px 12px;
}

.batch-detail-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 2rem;
    overflow-y: auto;
}

    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 2rem;
}
.modal-content { max-width: 600px; width: 100%; max-height: 85vh; background: white; position: relative; border-radius: 24px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); display: flex; flex-direction: column; overflow: hidden; }

.shop-modal-content {
    max-width: 500px;
}

.shop-grid-container {
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 12px;
}

@media (min-height: 800px) {
    .shop-grid-container {
        max-height: 70vh;
    }
}

.shop-item {
    transition: all 0.2s ease;
    cursor: pointer;
}

.shop-item:hover {
    background-color: rgba(99, 102, 241, 0.05) !important;
}

.shop-item.selected {
    background-color: rgba(16, 185, 129, 0.05) !important;
}

.shop-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}



.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 2rem 0; }

.edit-field { display: flex; flex-direction: column; gap: 0.5rem; }

.edit-field label { font-size: 0.875rem; font-weight: 600; color: var(--text-dim); }

.edit-field input,
.edit-field select,
.edit-field textarea {
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #f8fafc;
    width: 100%;
}

.nav-btn.success {
    background: var(--success) !important;
    color: white !important;
}
.nav-btn.danger {
    background: var(--danger) !important;
    color: white !important;
}

.large-btn {
    padding: 1rem 2.5rem !important;
    font-size: 1.1rem !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.3) !important;
}

.edit-field textarea {
    height: 100px;
}

.edit-field input:disabled, 
.edit-field select:disabled, 
.edit-field textarea:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
    opacity: 0.7;
}

.status-badge.review { background: #fef3c7; color: #92400e; }
.batch-header {
    background: #f1f5f9;
    cursor: pointer;
    padding: 12px 20px !important;
    font-size: 0.95rem;
    transition: background 0.2s;
    width: 100%;
    box-sizing: border-box;
}
.batch-header:hover { background: #e2e8f0; }
.batch-toggle { display: inline-block; width: 20px; color: var(--primary); transition: transform 0.2s; }
.batch-count { font-weight: normal; font-size: 0.8rem; color: #64748b; margin-left: 8px; }

.row-editing {
    background: #f8fafc !important;
}

.row-editing input, 
.row-editing select {
    border: 1px solid var(--primary);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.85rem;
    background-color: #f0f7ff;
    transition: background-color 0.2s;
}

.direct-input {
    background-color: #f8fafc;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0 4px;
    transition: all 0.2s;
    height: 26px;
    line-height: normal;
    box-sizing: border-box;
    display: block;
    margin: 0 auto;
}

.direct-input:hover, .direct-input:focus {
    background-color: #f0f7ff;
    border-color: #3b82f6;
    outline: none;
}

.direct-input.dirty {
    color: #b91c1c !important;
    font-weight: 600;
    background-color: #fff1f2 !important;
}

.row-editing td {
    padding: 0 8px !important;
    vertical-align: middle !important;
}

td {
    padding: 0 0.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
    color: var(--text-main) !important;
    vertical-align: middle;
    font-size: 0.85rem;
}

.header-group-erp { background-color: rgba(67, 97, 238, 0.1) !important; color: #1e40af !important; border-right: 1px solid rgba(67, 97, 238, 0.2) !important; }
.header-group-purchase { background-color: rgba(245, 158, 11, 0.1) !important; color: #92400e !important; border-right: 1px solid rgba(245, 158, 11, 0.2) !important; }
.header-group-cost { background-color: rgba(245, 158, 11, 0.06) !important; color: #92400e !important; border-right: 1px solid rgba(245, 158, 11, 0.2) !important; }
.header-group-s1 { background-color: rgba(16, 185, 129, 0.12) !important; color: #065f46 !important; border-right: 1px solid rgba(16, 185, 129, 0.2) !important; }
.header-group-tradepro { background-color: rgba(16, 185, 129, 0.08) !important; color: #065f46 !important; border-right: 1px solid rgba(16, 185, 129, 0.2) !important; }
.header-group-final { background-color: rgba(5, 150, 105, 0.12) !important; color: #064e3b !important; }

.header-edit-btn {
    background: transparent;
    border: none;
    color: currentColor;
    opacity: 0.5;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.8rem;
    margin-left: 4px;
}

.header-edit-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

th {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.75rem 0.5rem;
    background: #f8fafc;
    color: #64748b !important;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
    text-align: center;
    vertical-align: middle !important;
}

td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main) !important;
    vertical-align: middle;
    font-size: 0.825rem;
    text-align: center;
}


.barcode-cell {
    font-family: inherit;
    letter-spacing: 0.02em;
}

tr:hover {
    background: rgba(79, 70, 229, 0.02);
}

.row-highlight {
    animation: flash-highlight 5s ease-out forwards;
}

@keyframes flash-highlight {
    0% { background-color: rgba(79, 70, 229, 0.4); }
    30% { background-color: rgba(79, 70, 229, 0.2); }
    100% { background-color: transparent; }
}

.status-badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 999px;
    font-size: 0.725rem;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid transparent;
    line-height: 1.2;
}

.status-badge { padding: 4px 10px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }

.batch-table { 
    table-layout: auto; 
    width: 100% !important; 
    border-collapse: collapse; 
}

.batch-table th, .batch-table td {
    text-align: center !important;
}

.name-cell, .notes-cell {
    text-align: left !important;
}

.status-badge.imported { background: #e0e7ff; color: #3730a3; }
.status-badge.approved { background: #eff6ff; color: #1d4ed8; border: 1px solid #dbeafe; }
.status-badge.declined { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.status-badge.pricing { background: #fef9c3; color: #854d0e; }
.status-badge.review { background: #fef3c7; color: #92400e; }

.sum-badge { padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.sum-badge.status-approved { background: #eff6ff; color: #1d4ed8; border: 1px solid #dbeafe; }
.sum-badge.status-ready-erp { background: #f5f3ff; color: #7c3aed; border: 1px solid #ddd6fe; }
.sum-badge.status-completed { background: #ecfdf5; color: #059669; border: 1px solid #d1fae5; }
.sum-badge.status-declined { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.sum-badge.status-imported { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.sum-badge.status-working { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

.batch-main-status {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-right: 15px;
    transition: all 0.2s;
}
.batch-main-status.status-imported { background: #f1f5f9; color: #475569; border: 1.5px solid #e2e8f0; }
.batch-main-status.status-review { background: #fffbeb; color: #b45309; border: 1.5px solid #fde68a; }
.batch-main-status.status-pricing { background: #eff6ff; color: #2563eb; border: 1.5px solid #bfdbfe; }
.batch-main-status.status-approved { background: #3b82f6; color: #ffffff; border: 1.5px solid #2563eb; font-weight: 800; box-shadow: 0 0 12px rgba(59, 130, 246, 0.15); }
.batch-main-status.status-ready-erp { background: #8b5cf6; color: #ffffff; border: 1.5px solid #7c3aed; font-weight: 800; box-shadow: 0 0 12px rgba(139, 92, 246, 0.15); }
.batch-main-status.status-completed { background: #10b981; color: #ffffff; border: 1.5px solid #059669; font-weight: 800; box-shadow: 0 0 12px rgba(16, 185, 129, 0.15); }

.header-group-comp { background-color: #fff1f2 !important; color: #9f1239 !important; border-right: 1px solid rgba(251, 113, 133, 0.2) !important; }
th.header-group-comp { box-shadow: inset 0 -3px 0 #fb7185, inset 0 -1px 0 #e2e8f0 !important; }
.maxela-cell, .polonez-cell { background-color: #fff1f2 !important; font-weight: 500; }
.batch-main-status.status-declined { background: #fef2f2; color: #b91c1c; border: 1.5px solid #fecaca; }

.batch-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    padding-right: 1.5rem;
}

.batch-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #475569;
    background: #f1f5f9;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    white-space: nowrap;
}

.batch-info i {
    color: var(--primary);
    font-size: 0.9rem;
}

.img-placeholder {
    width: 44px;
    height: 44px;
    background: #f1f5f9;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.img-preview {
    display: none;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 250px;
    height: 250px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 999;
    padding: 10px;
    border: 1px solid var(--border);
    margin-left: 15px;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1e293b;
    color: #ffffff !important;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    z-index: 99999 !important;
    animation: slideUp 0.3s ease;
    font-weight: 600;
    min-width: 300px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
    filter: none !important;
    backdrop-filter: none !important;
}

.toast.error { background: #ef4444 !important; border-color: #fca5a5; }
.toast.success { background: #10b981 !important; border-color: #6ee7b7; }
.toast.warning { background: #f59e0b !important; border-color: #fcd34d; color: #000000 !important; }

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.history-container {
    margin-top: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    padding: 1rem;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
}

.history-user {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.history-date {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

.history-comment {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.5;
}

.log-line {
    padding: 2px 0;
    border-bottom: 1px dashed rgba(0,0,0,0.05);
}
.log-line:last-child { border-bottom: none; }

.note-prep {
    font-weight: 700;
    color: var(--primary);
    margin: 0 4px;
}

.history-desc {
    font-size: 0.9rem;
    color: var(--text-main);
}

#offers-view {
    min-height: calc(100vh - 63px);
}


.offers-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.batch-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease-in-out;
    width: 100%;
}

.batch-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: #94a3b8;
}

.batch-header {
    background: linear-gradient(to right, #ffffff, #f9fafb);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s;
    user-select: none;
    min-height: 61px;
    top: 0;
    z-index: 1020;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    background: white;
}

.batch-content {
    background: #ffffff;
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    border-top: 1px solid var(--border);
}

.table-wrapper {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border);
    position: relative;
}

.batch-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
    border-top-left-radius: 11px;
    z-index: 1;
}

.batch-card:not(.expanded) .batch-header::before {
    border-bottom-left-radius: 12px;
}

.batch-card.expanded .batch-header::before {
    opacity: 1;
}

.batch-header:hover {
    background: #f1f5f9;
}

.batch-info-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.batch-info-main strong {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--sidebar-bg);
}

.batch-metadata {
    display: flex;
    gap: 1rem;
    margin-right: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
}

.batch-table-container {
    overflow-x: auto;
    width: 100%;
    position: relative;
    scrollbar-width: thin;
    padding-bottom: 5px;
}

.batch-controls {
    position: sticky;
    top: 61px;
    z-index: 1015;
    background: #ffffff;
    padding: 0.75rem 0;
    border-bottom: 3px solid #f1f5f9;
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0;
}

.batch-metadata span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(0,0,0,0.02);
    padding: 0.15rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.03);
}

.batch-header:hover {
    background: #f1f5f9;
}

.batch-table {
    width: 100%;
    border-collapse: collapse;
}

.batch-table th {
    padding: 0;
    font-weight: 500;
    color: var(--text-dim);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border-bottom: 2px solid #eef2f6;
    background: #fcfcfc;
    position: sticky;
    top: 0;
    z-index: 1010;
    vertical-align: middle !important;
    height: auto;
}

.calc-header-pirkimo { background: #fef3c7 !important; color: #92400e !important; border-bottom: none !important; }
.calc-header-savikaina { background: #dbeafe !important; color: #1e40af !important; border-bottom: none !important; }
.calc-header-s1 { background: #ffedd5 !important; color: #9a3412 !important; border-bottom: none !important; }
.calc-header-profit { background: #fdf6b2 !important; color: #723b13 !important; }
.calc-header-tradepro { background: #dcfce7 !important; color: #166534 !important; border-bottom: none !important; }
.calc-header-final { background: #d1fae5 !important; color: #065f46 !important; }

.batch-table thead tr.sub-headers th {
    padding: 4px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    position: sticky;
    top: 147px;
    z-index: 1009;
    background: #f8fafc;
}

.header-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    margin-left: 4px;
    padding: 0;
    font-size: 0.75rem;
    transition: opacity 0.2s, transform 0.2s;
    vertical-align: middle;
}

.header-edit-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.batch-table td {
    padding: 0 4px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.8rem;
    vertical-align: middle !important;
    height: 38px;
    box-sizing: border-box;
    text-align: center;
}

.pagination-batch {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: #fcfcfc;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-dim);
}

.batch-content .table-wrapper {
    flex: none;
    height: auto;
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    border: none;
    border-radius: 0;
    margin-bottom: 0;
}

.batch-count {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-right: 0.5rem;
}

.batch-status-summary {
    display: flex;
    gap: 0.4rem;
    margin-left: 0.5rem;
}
#mobile-menu-btn {
    color: var(--sidebar-bg);
    font-size: 1.8rem;
    padding: 0;
}

.mobile-only {
    display: flex;
}

.sum-badge {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
}

.sum-badge.status-approved { background: rgba(59, 130, 246, 0.1); color: #2563eb; border: 1px solid rgba(59, 130, 246, 0.2); }
.sum-badge.status-imported { background: rgba(79, 70, 229, 0.1); color: var(--primary); border: 1px solid rgba(79, 70, 229, 0.2); }
.sum-badge.status-declined { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

.history-changes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}
.change-tag {
    font-size: 0.75rem;
    background: #f8fafc;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    color: var(--primary);
    font-weight: 500;
}
.status-path {
    font-weight: 600;
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}
.action-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    align-items: center;
}

.action-note {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.4;
}

/* --- MOBILE PORTAL HEADER OPTIMIZATION --- */
@media (max-width: 768px) {
    .portal-top-bar {
        padding: 0 1rem;
        height: 70px;
    }

    .portal-logo span {
        display: none; /* Hide text, keep icon only */
    }

    .portal-user #portal-username {
        display: none; /* Hide name, keep avatar only */
    }

    .top-bar-right {
        gap: 0.5rem;
    }

    .portal-top-bar {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 1.5rem !important;
    }

    .top-bar-right {
        margin-left: auto !important; /* Forces user profile and logout to the far right */
        display: flex !important;
        align-items: center !important;
        gap: 1rem !important;
    }

    .module-breadcrumb {
        display: none !important;
    }

    .module-grid {
        grid-template-columns: 1fr !important; /* Force 1 column on mobile only */
        padding: 1rem;
    }
}

/* Global Module Grid (Desktop & Tablet) */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1400px;
    margin: 3rem auto 0;
    padding: 2rem;
}

.module-card {
    background: white;
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.module-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        width: 260px;
        box-shadow: 10px 0 30px rgba(0,0,0,0.2);
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        padding: 0.75rem;
        padding-top: env(safe-area-inset-top, 20px);
    }

    header {
        position: sticky;
        top: 0;
        background: var(--bg-light);
        z-index: 1100;
        padding: 1rem 0.5rem;
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }

    #mobile-menu-btn {
        position: absolute;
        left: 0;
        width: 48px;
        height: 48px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        font-size: 2rem;
        color: var(--sidebar-bg);
        background: transparent;
        border: none;
        cursor: pointer;
    }

    .header-left {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .header-left h1 {
        font-size: 1.6rem !important;
        font-weight: 600;
        margin: 0;
        text-align: center;
    }

    .user-profile {
        display: none;
    }
    
    .view {
        padding-top: 0;
        overflow-y: visible;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .batch-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.4rem 0.5rem;
        gap: 0.3rem;
    }

    .batch-info-main {
        width: 100%;
        font-size: 0.75rem; 
        gap: 0.3rem !important;
    }

    .batch-count {
        margin-left: 0;
    }

    .batch-meta {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        margin-left: 0;
        padding-right: 0;
        gap: 0.2rem;
        font-size: 0.65rem; 
    }

    .batch-metadata {
        flex-wrap: wrap;
        gap: 0.15rem;
        margin-right: 0;
    }

    #management-view .card-header-main {
        flex-direction: column;
        gap: 1rem;
    }

    #management-view .card-header-main button {
        width: 100% !important;
    }

    #management-view .table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    #users-table {
        min-width: 600px;
    }

    #users-table th, #users-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}

.requests-centered-container {
        max-width: 800px;
        margin: 2rem auto;
        padding-bottom: 5rem;
    }

    .card-header-main {
        text-align: center;
        margin-bottom: 2rem;
    }

    .card-header-main h2 {
        font-size: 1.8rem;
        color: var(--sidebar-bg);
        margin-bottom: 0.5rem;
    }

    .card-header-main p {
        color: var(--text-dim);
    }

    .premium-form {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .form-group-item {
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
    }

    .form-group-item label {
        font-weight: 600;
        color: var(--text-main);
        font-size: 0.95rem;
        padding-left: 4px;
    }

    .custom-file-upload {
        position: relative;
    }

    .custom-file-upload input {
        position: absolute;
        opacity: 0;
        inset: 0;
        cursor: pointer;
        z-index: 2;
    }

    .file-drop-area {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 2rem;
        border: 2px dashed var(--border);
        border-radius: 12px;
        background: rgba(0,0,0,0.02);
        transition: all 0.3s;
        gap: 0.5rem;
    }

    .custom-file-upload:hover .file-drop-area {
        border-color: var(--primary);
        background: rgba(99, 102, 241, 0.05);
        color: var(--primary);
    }

.table-scroll-area {
    position: relative;
    overflow-x: auto;
}

.table-scroll-area {
    position: relative;
    overflow: auto !important;
}

.batch-table {
    border-collapse: separate !important; 
    border-spacing: 0 !important;
}

/* 1. Base Column Definitions (Data and Header) */
.img-cell, .barcode-cell, .name-cell {
    position: sticky !important;
    background-color: #ffffff !important;
    z-index: 10 !important;
    box-sizing: border-box;
    /* Use outline to cover neighboring borders and hide gaps */
    outline: 1px solid #ffffff;
}

.img-cell {
    left: 0 !important;
    width: 60px !important;
    min-width: 60px !important;
}

.barcode-cell {
    left: 59px !important; /* Overlap by 1px to hide gap */
    width: 131px !important;
    min-width: 131px !important;
}

.name-cell {
    left: 189px !important; /* Overlap by 1px to hide gap */
    width: 321px !important;
    min-width: 321px !important;
    border-right: 2px solid #cbd5e1 !important;
}

/* 2. Header Specifics */
.batch-table thead th.img-cell, 
.batch-table thead th.barcode-cell, 
.batch-table thead th.name-cell {
    top: 0 !important;
    z-index: 4001 !important;
    background-color: #f8fafc !important;
    outline: 1px solid #f8fafc;
    vertical-align: middle !important;
}

.batch-table thead tr.sub-headers th {
    top: 3.5rem !important;
    z-index: 2500 !important;
    background-color: #f1f5f9;
}

.batch-table tbody tr:nth-child(even) td.img-cell,
.batch-table tbody tr:nth-child(even) td.barcode-cell,
.batch-table tbody tr:nth-child(even) td.name-cell {
    background-color: #f8fafc !important;
}

.batch-table tbody tr:hover td.img-cell,
.batch-table tbody tr:hover td.barcode-cell,
.batch-table tbody tr:hover td.name-cell {
    background-color: #f1f5f9 !important;
}

.th-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
    padding: 8px 4px;
    box-sizing: border-box;
    width: 100%;
    height: 100% !important;
    min-height: 4.5rem;
    white-space: normal;
}

}

.th-inner span {
    line-height: 1.2;
    display: block;
    width: 100%;
}

.request-batch-card {
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.request-batch-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    gap: 1rem;
    transition: background 0.2s;
}

.request-batch-header:hover {
    background: #f1f5f9;
}

.request-batch-header i.toggle-icon {
    font-size: 0.8rem;
    color: var(--text-dim);
    transition: transform 0.2s;
}

.request-batch-card.expanded i.toggle-icon {
    transform: rotate(90deg);
}

.request-batch-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.request-batch-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.request-batch-content {
    margin-top: -5px;
    padding: 1.5rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-top: none;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.request-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.request-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-dim);
    border-bottom: 2px solid var(--border);
}

.request-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.request-photo-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: zoom-in;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.request-photo-thumb:hover {
    transform: scale(5);
    z-index: 1000;
    position: relative;
    box-shadow: 0 15px 45px rgba(0,0,0,0.4);
    border: 4px solid white;
    background: white;
}

.request-actions-cell {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .request-batch-meta { display: none; }
    .request-table th:nth-child(3), .request-table td:nth-child(3) { display: none; }
}

.user-plus-only { display: table-cell; }
body.role-user_plus .user-plus-only, 
body.role-admin .user-plus-only { 
    display: table-cell; 
}

.batch-table {
    table-layout: auto;
    width: auto;
    border-collapse: collapse;
}

.batch-table thead tr.sub-headers th {
    top: 2.625rem !important;
    z-index: 109;
    background: #f1f5f9;
    font-size: 0.75rem;
    padding: 0 !important;
    border-bottom: 1px solid var(--border);
    vertical-align: bottom !important;
}

.direct-input {
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
    border: none !important;
    border-bottom: 1px dashed rgba(0,0,0,0.1) !important;
    background: rgba(99, 102, 241, 0.03) !important;
    font-size: 0.9rem;
    padding: 2px 4px !important;
    border-radius: 4px !important;
    margin: 0 !important;
    text-align: inherit;
    color: inherit;
    font-family: inherit;
    min-height: 24px;
    outline: none;
    transition: background 0.2s;
}

.direct-input:hover {
    background: rgba(99, 102, 241, 0.08) !important;
}

.direct-input:focus {
    background: white !important;
    box-shadow: inset 0 0 0 1px #3b82f6 !important;
}

.barcode-cell { min-width: 140px; }

.img-cell, .barcode-cell, .unit-cell, .pal-vnt-cell, .exp-cell, .price-xls-cell, 
.calc-unit-cell, .calc-unit-1000-cell, .calc-pcs-pal-cell, .calc-trans-cell,
.buy-price-old-cell, .buy-price-new-cell, .cost-pal-cell, .cost-for-cell, .cost-sugar-cell,
.s1-pal-cell, .s1-for-cell, .s1-markup-pal-cell, .s1-markup-for-cell,
.tp-s1-cell, .tp-profit-pal-cell, .tp-profit-for-cell, .vat-cell,
.final-shop-asort-cell, .final-shop-uzsak-calc-cell, .final-shop-uzsak-shop-cell, .final-shop-cell {
    width: 1%;
    min-width: max-content !important;
    white-space: nowrap;
    text-align: center;
    padding: 0 8px !important;
    overflow: visible !important;
}
.erp-type-cell, .erp-type-shops-cell, .suggested-type-cell, .status-cell {
    width: 1%;
    min-width: max-content !important;
    white-space: nowrap;
    text-align: center;
    padding: 6px 10px;
}

.name-cell {
    width: 1%;
    min-width: max-content !important;
    white-space: nowrap !important;
    text-align: left !important;
    padding: 6px 12px;
}

.notes-cell {
    width: 1%;
    white-space: nowrap;
    text-align: left !important;
    padding: 0 12px !important;
    min-width: max-content !important;
}

.name-cell .direct-input, .notes-cell .direct-input,
th.name-cell, th.notes-cell {
    text-align: left !important;
    justify-content: flex-start !important;
}

.actions-cell {
    width: 100%;
    min-width: 200px;
    white-space: nowrap;
    text-align: center;
    padding: 4px 8px;
}

th.name-cell, th.notes-cell {
    overflow: visible;
    vertical-align: middle !important;
    padding: 0 !important;
}

.header-group-purchase { background-color: #fef2f2 !important; }
.header-group-cost { background-color: #f0fdf4 !important; }
.header-group-s1 { background-color: #eff6ff !important; }
.header-group-tradepro { background-color: #faf5ff !important; }
.header-group-final { background-color: #fffbeb !important; }
.header-group-erp { background-color: #eef2ff !important; }

th.header-group-purchase { box-shadow: inset 0 -3px 0 #ef4444, inset 0 -1px 0 #e2e8f0 !important; }
th.header-group-cost { box-shadow: inset 0 -3px 0 #22c55e, inset 0 -1px 0 #e2e8f0 !important; }
th.header-group-s1 { box-shadow: inset 0 -3px 0 #3b82f6, inset 0 -1px 0 #e2e8f0 !important; }
th.header-group-tradepro { box-shadow: inset 0 -3px 0 #a855f7, inset 0 -1px 0 #e2e8f0 !important; }
th.header-group-final { box-shadow: inset 0 -3px 0 #f59e0b, inset 0 -1px 0 #e2e8f0 !important; }
th.header-group-erp { box-shadow: inset 0 -3px 0 #6366f1, inset 0 -1px 0 #e2e8f0 !important; }

.header-label {
    display: block;
    width: 100%;
    margin-bottom: 2px;
}

.header-control {
    display: block;
    width: 100%;
    margin-top: 4px;
    display: flex;
    justify-content: center;
}

.header-input {
    width: 45px !important;
    min-width: 45px !important;
    font-size: 0.7rem !important;
    border: 1px solid #93c5fd !important;
    border-radius: 4px !important;
    text-align: center !important;
    padding: 2px !important;
    background: white !important;
    color: var(--primary) !important;
    font-weight: 700 !important;
}

.batch-table td {
    padding: 8px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    vertical-align: middle;
}

.batch-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.02);
    position: relative;
    z-index: 100;
}

.direct-input:hover {
    border-color: rgba(79, 70, 229, 0.2);
    background: rgba(255, 255, 255, 0.5);
}

.direct-input:hover {
    border-color: rgba(79, 70, 229, 0.2);
    background: rgba(255, 255, 255, 0.5);
}

.direct-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.cell-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 38px;
    box-sizing: border-box;
    text-align: center;
}


.drag-handle {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border: 1px solid white;
    cursor: crosshair;
    z-index: 105;
    display: none;
}

.cell-wrapper:focus-within .drag-handle {
    display: block;
}

.drag-highlight {
    background-color: rgba(79, 70, 229, 0.1) !important;
    position: relative;
}

.drag-highlight::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border: 1px dashed var(--primary);
    pointer-events: none;
}

.recal-pulse {
    animation: recal-pulse-anim 0.3s ease-out;
    background-color: rgba(147, 197, 253, 0.1) !important;
}

@keyframes recal-pulse-anim {
    0% { background-color: transparent; }
    50% { background-color: rgba(147, 197, 253, 0.2); }
    100% { background-color: transparent; }
}

.formula-alert {
    color: #ef4444 !important;
    font-weight: 800 !important;
}

.vertical-header {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    padding: 12px 4px !important;
    font-size: 0.75rem !important;
    min-width: 30px !important;
    max-height: 100px;
    text-align: center;
    vertical-align: middle;
}

.header-top {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.back-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.back-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #cbd5e1;
    transform: translateX(-4px);
}

.detail-title-area {
    flex-grow: 1;
}

.detail-title-area h2 {
    font-size: 1.35rem;
    color: #1e293b;
    margin: 0 0 0.35rem 0;
    font-weight: 800;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.detail-stats {
    display: flex;
    gap: 0.75rem;
}

.stat-badge {
    font-size: 0.75rem;
    background: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}

.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

.batch-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.batch-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    border-color: var(--primary);
}

.batch-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px 0 0 12px;
}

.batch-card:hover::before {
    opacity: 1;
}

.batch-card.unread {
    border: 1px solid var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
    overflow: visible !important;
}

.batch-card.unread:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
}

.batch-card.unread:hover::before {
    opacity: 0 !important;
}

.batch-main-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.batch-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.batch-count {
    color: #64748b;
    font-weight: 500;
    font-size: 0.9rem;
}

.batch-detail-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    gap: 1rem;
    padding: 0;
}

.batch-card-detail {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden !important;
    max-height: calc(100vh - 180px) !important;
    height: 100%;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 1rem 1.25rem 3rem 1.25rem !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.price-increase {
    color: #ef4444 !important;
    font-weight: 700 !important;
    background-color: #fef2f2 !important;
    border-color: #fecaca !important;
}

.table-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: visible !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.table-scroll-area {
    flex: 1;
    overflow-x: auto !important; 
    overflow-y: visible !important;
    position: relative;
    width: 100%;
    min-height: 0;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
    border-radius: inherit;
}

.table-scroll-area::-webkit-scrollbar {
    width: 12px !important;
    height: 12px !important;
    display: block !important;
}

.table-scroll-area::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
    border-radius: 6px !important;
}

.table-scroll-area::-webkit-scrollbar-thumb {
    background: #94a3b8 !important;
    border-radius: 6px !important;
    border: 3px solid #f1f5f9 !important;
    min-height: 40px !important;
}

.table-scroll-area::-webkit-scrollbar-thumb:hover {
    background: #64748b !important;
}

.table-wrapper table {
    width: auto;
    border-collapse: separate;
    border-spacing: 0;
}

.table-wrapper thead th {
    position: sticky;
    top: 0;
    z-index: 2000 !important;
    background-color: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 0 !important;
    border-right: 1px solid #e2e8f0;
    box-shadow: inset 0 -1px 0 #e2e8f0;
    box-sizing: border-box;
    vertical-align: middle !important;
    min-width: max-content !important;
}

.table-wrapper thead tr:first-child th {
    height: 42px !important;
}

.table-wrapper thead tr.sub-headers th {
    top: 2.625rem !important;
    z-index: 1500 !important;
    font-size: 0.62rem;
    padding: 0 !important;
    background-color: #f1f5f9;
    box-shadow: inset 0 -1px 0 #e2e8f0;
    vertical-align: middle !important;
    min-width: max-content !important;
    height: 42px !important;
}

.table-wrapper thead th[rowspan="2"] {
    z-index: 2010 !important;
    height: 84px !important;
}

tr.sub-headers th.vertical-header {
    background-color: #f8fafc;
    border-right: 1px solid var(--border);
}

.img-cell, .barcode-cell, .name-cell {
    position: sticky !important;
    z-index: 4000 !important;
    background-color: #ffffff !important;
    box-shadow: 2px 0 5px -2px rgba(0,0,0,0.1);
}

.batch-table thead th.img-cell, 
.batch-table thead th.barcode-cell, 
.batch-table thead th.name-cell {
    z-index: 5000 !important;
    background-color: #f8fafc !important;
    top: 0 !important;
}

.batch-table thead tr.sub-headers th.img-cell,
.batch-table thead tr.sub-headers th.barcode-cell,
.batch-table thead tr.sub-headers th.name-cell {
    z-index: 5001 !important;
    top: 2.625rem !important;
}

.img-cell { left: 0 !important; width: 3.75rem !important; min-width: 3.75rem !important; }
.barcode-cell { left: 3.75rem !important; width: 8.125rem !important; min-width: 8.125rem !important; }
.name-cell { 
    left: 11.875rem !important; 
    width: var(--name-col-width, 20rem) !important; 
    min-width: var(--name-col-width, 20rem) !important; 
    max-width: var(--name-col-width, 20rem) !important; 
    border-right: 1px solid #cbd5e1 !important;
    overflow: hidden !important;
    text-align: left !important;
    padding-left: 10px !important;
}

.name-cell-inner {
    width: 100%;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    display: block !important;
    text-align: left !important;
    width: 100% !important;
}

#global-image-preview {
    position: fixed;
    z-index: 1000000;
    pointer-events: none;
    display: none;
    background: white;
    padding: 6px;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 2px solid white;
    max-width: 450px;
    transform: none;
}

#global-image-preview img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    object-fit: contain;
}

#main-view .price-increase, 
#offer-view .price-increase {
    color: #ef4444 !important; 
    font-weight: 700 !important;
    background-color: #fef2f2 !important;
    border: 1px solid #fecaca !important;
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    transition: opacity 0.3s ease;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    color: var(--primary);
    font-weight: 600;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.1);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loader-text {
    font-size: 1.1rem;
    letter-spacing: 0.05em;
}

.price-alert-up {
    color: #ef4444 !important;
    font-weight: 700 !important;
}

.modal-is-open #app-root {
    filter: blur(8px) grayscale(20%);
    pointer-events: none;
    transition: filter 0.3s ease;
}

.modal-blur-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99998;
    transition: opacity 0.3s ease;
}

.modal-blur-overlay.hidden {
    display: none;
    opacity: 0;
}

.modal {
    z-index: 99999 !important;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 0.5rem 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.header-logout-btn {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.header-logout-btn:hover {
    background: #fecaca;
    transform: scale(1.05);
}

.header-logout-btn i {
    font-size: 0.9rem;
}

@media (max-width: 1024px) {
    .offers-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 30000 !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 50px rgba(0,0,0,0.1);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        backdrop-filter: blur(4px);
        z-index: 29999 !important;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        pointer-events: auto;
        opacity: 1;
    }

    .main-content {
        width: 100%;
        height: auto !important;
        overflow: visible !important;
        flex: none;
        padding-top: 0 !important;
    }

    .sidebar-layout::before {
        display: none;
    }

    .sidebar-layout {
        height: auto !important;
        min-height: 100dvh;
        overflow: visible !important;
        display: block; 
        background: white !important;
    }

    .main-content, 
    #offers-view, 
    #dashboard-view, 
    #excel-import-view, 
    #product-list-view, 
    #request-list-view, 
    #request-detail-view, 
    #new-request-view, 
    #management-view {
        background: white !important;
    }

    header {
        position: fixed !important;
        top: 10px !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        height: 60px !important;
        background: white !important;
        border-radius: 16px !important;
        border: 1px solid var(--border) !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
        z-index: 5000 !important;
        display: grid !important;
        grid-template-columns: 60px 1fr auto !important;
        align-items: center !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    header::before {
        content: "" !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 12px !important;
        background: white !important;
        z-index: -1 !important;
        display: block !important;
    }

    header::after { display: none !important; }

    header .header-left,
    header .user-profile {
        grid-row: 1 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: auto !important;
        min-width: 60px !important;
        background: transparent !important;
        background-image: none !important;
        border: none !important;
        box-shadow: none !important;
        outline: none !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 0 !important;
        z-index: 20 !important;
    }

    header .header-left { grid-column: 1 !important; }
    header .user-profile { grid-column: 3 !important; }

    #view-title {
        grid-column: 2 !important;
        grid-row: 1 !important;
        text-align: center !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        color: #1e293b !important;
        z-index: 10 !important;
    }

    header #mobile-menu-btn,
    header .header-logout-btn {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        aspect-ratio: 1/1 !important;
        border-radius: 12px !important;
        background: #f1f5f9 !important;
        border: none !important;
        color: #475569 !important;
        padding: 0 !important;
        margin: 0 auto !important;
        font-size: 1.2rem !important;
        -webkit-tap-highlight-color: transparent;
    }

    header .header-logout-btn {
        background: #fee2e2 !important;
        color: #ef4444 !important;
    }

    header .user-profile #current-username {
        display: none !important;
    }

    .main-content {
        padding: 0 !important;
        background: white !important;
    }

    .view {
        padding: 0 !important;
        margin-top: 85px !important;
    }

    .card.glass {
        margin: 0 12px 20px 12px !important;
        width: auto !important;
    }

    .requests-container, 
    .batch-card-detail, 
    .batch-detail-container,
    .premium-form,
    .tasks-list,
    #request-form,
    #request-assigned-users-list {
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
        padding-right: 0 !important;
        margin-right: 0 !important;
    }

    .stats-grid {
        margin-top: 10px !important;
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .offers-grid {
        grid-template-columns: 1fr !important;
    }

    .batch-card.horizontal {
        flex-direction: column;
        gap: 1rem !important;
    }

    .table-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1.25rem !important;
    }
    .table-header > * {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
    }

    .batch-title {
        border-left: none !important;
        padding-left: 0 !important;
        white-space: normal !important;
        max-width: 100% !important;
    }

    .table-actions {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
        display: flex;
        gap: 0.5rem;
    }

    .table-actions .btn-primary {
        flex: 1;
        white-space: nowrap;
        padding: 0.6rem 1rem;
    }

    .table-controls {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
    }

    .search-input {
        max-width: 100% !important;
    }

    .request-detail-view div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        height: auto !important;
        min-height: 0 !important;
    }
}

@keyframes slideInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 768px) {
    html, body { overflow-x: hidden !important; overflow-y: auto !important; height: auto !important; min-height: 100% !important; }
    .main-content { overflow-y: auto !important; height: auto !important; min-height: 100vh !important; }
    #offers-view, #dashboard-view, #excel-import-view, #product-list-view, #request-list-view, .batch-detail-container, .batch-card-detail { max-height: none !important; overflow: visible !important; height: auto !important; }
}

@media (max-width: 1100px) {
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 10000; transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 20px 0 50px rgba(0,0,0,0.1); }
    .sidebar.open, .sidebar.active { transform: translateX(0); }
    .sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); z-index: 9999; pointer-events: none; opacity: 0; transition: opacity 0.3s ease; }
    .sidebar-overlay.active { pointer-events: auto; opacity: 1; }
    .main-content { width: 100%; padding: 1rem !important; }
    header { padding: 1rem 0; margin-bottom: 1rem; }
    .mobile-only { display: flex !important; }
    #sidebar-toggle { display: none; }
}

.batch-info-main { min-width: 250px !important; flex: 2 !important; }
.batch-title { white-space: normal !important; word-break: break-all !important; line-height: 1.3 !important; }
.batch-metadata { flex-wrap: wrap !important; gap: 1rem !important; flex: 1 !important; justify-content: flex-end !important; min-width: 200px !important; }
@media (max-width: 600px) { .batch-card.horizontal { flex-direction: column !important; } .batch-metadata { justify-content: flex-start !important; } }

.batches-container { max-width: 1200px !important; margin: 0 auto !important; }
.batch-card.horizontal { justify-content: flex-start !important; gap: 3rem !important; }
.batch-info-main { flex: 0 0 350px !important; }
.batch-metadata { flex: 0 0 auto !important; margin-left: auto !important; justify-content: flex-end !important; }
.offers-list { }

@media (min-width: 1024px) {
    .request-detail-grid {
        height: calc(100vh - 200px) !important;
        overflow: hidden !important;
        display: grid !important;
        grid-template-columns: 1.2fr 1fr !important;
        gap: 1.5rem !important;
    }
    .req-left-col, .req-right-col {
        height: 100% !important;
        overflow-y: auto !important;
        padding-right: 0.5rem !important;
    }
}

@media (min-width: 1024px) {
    .offers-list, #requests-list {
        max-height: calc(100vh - 280px) !important;
        overflow-y: auto !important;
        padding-right: 0.5rem !important;
    }
}

.batches-container { max-width: none !important; width: 100% !important; }
.batch-card.horizontal {
    display: grid !important;
    grid-template-columns: 2fr 1fr 1.5fr 1fr auto !important;
    align-items: center !important;
    gap: 2rem !important;
    padding: 1.25rem 2rem !important;
    min-height: 90px !important;
}
.batch-info-main { min-width: 0 !important; }
.batch-metadata { 
    display: grid !important;
    grid-template-columns: 1fr 1fr auto !important;
    gap: 2rem !important;
    width: 100% !important;
    justify-content: flex-end !important;
    align-items: center !important;
    flex: none !important;
}


@media (max-width: 1023px) {
    .batch-card.horizontal {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
        padding: 1rem !important;
        min-height: auto !important;
        height: auto !important;
    }
    .batch-info-main { 
        flex: none !important; 
        width: 100% !important;
        margin-bottom: 0.5rem;
    }
    .batch-status-group, .batch-progress-group {
        justify-content: flex-start !important;
        width: 100% !important;
    }
    .batch-metadata-group {
        flex-direction: column !important;
        gap: 0.5rem !important;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid #f1f5f9;
    }
    .batch-actions-group {
        width: 100% !important;
        margin-top: 0.5rem;
    }
    .batch-actions-group .btn-primary {
        width: 100% !important;
        justify-content: center;
    }
}

.detail-header-compact {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 1rem !important;
    flex-wrap: wrap !important;
    background: white !important;
    padding: 1rem 1.5rem !important;
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
    margin-bottom: 1.5rem !important;
}
.detail-actions-group {
    display: flex !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
}
@media (max-width: 600px) {
    .detail-header-compact { 
        flex-direction: column !important; 
        align-items: stretch !important; 
        padding: 1rem !important; 
        gap: 0.75rem !important;
    }
    .detail-actions-group { 
        justify-content: center !important; 
        gap: 0.5rem !important;
    }
    .detail-actions-group .btn-primary {
        flex: 1 !important;
        font-size: 0.8rem !important;
        padding: 0.6rem 0.5rem !important;
    }
}

.request-detail-grid {
    display: grid !important;
    grid-template-columns: 350px 1fr 400px !important;
    gap: 1.5rem !important;
    width: 100% !important;
}
@media (max-width: 1400px) {
    .request-detail-grid { grid-template-columns: 300px 1fr 350px !important; }
 text-transform: none;
}
@media (max-width: 1100px) {
    .request-detail-grid {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .req-grid-col { width: 100% !important; }
}

.request-detail-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
    width: 100%;
    margin: 1.5rem 0;
    flex: 1;
    min-height: 0;
}

.req-left-col, .req-right-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 0;
    height: 100%;
}

@media (min-width: 769px) {
    #responses-thread {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }
}

.card.glass {
    border-radius: 20px !important;
    overflow: hidden !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05) !important;
    background: #ffffff !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.description-text-area {
    background: #ffffff !important;
    border-left: 4px solid #6366f1 !important;
    padding-left: 1.5rem !important;
    font-size: 1.05rem !important;
    line-height: 1.8 !important;
    color: #334155 !important;
    font-weight: 500 !important;
}

.audit-pill {
    background: #f8fafc !important;
    border: 1px solid #f1f5f9 !important;
    border-radius: 12px !important;
    padding: 0.75rem 1rem !important;
    transition: all 0.2s ease;
}

.audit-pill:hover {
    background: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    border-color: #e2e8f0 !important;
}

.request-detail-view img {
    border-radius: 12px !important;
}

.request-detail-view input, .request-detail-view textarea {
    border-radius: 10px !important;
}

.request-detail-grid {
    display: grid !important;
    grid-template-columns: 1.2fr 0.8fr !important;
    gap: 1.5rem !important;
    width: 100% !important;
    height: calc(100vh - 180px) !important;
    min-height: 0 !important;
    overflow: hidden !important;
    margin: 1rem 0 0 0 !important;
}

.req-left-col, .req-right-col {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
}

:root {
    --portal-bg: #f8fafc;
    --portal-top-height: 4.375rem;
}

.portal-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--portal-top-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 2000;
}

/* Master Layout for Modules */
.sidebar-layout {
    margin-top: var(--portal-top-height) !important;
    height: calc(100dvh - var(--portal-top-height)) !important;
    display: flex; /* Remove !important */
    flex-direction: row; 
    overflow: hidden;
    animation: viewFadeIn 0.4s ease;
}

.portal-view {
    margin-top: var(--portal-top-height) !important;
    height: calc(100dvh - var(--portal-top-height)) !important;
    display: flex; /* Remove !important */
    flex-direction: column;
    overflow-y: auto;
    animation: viewFadeIn 0.4s ease;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    height: 100%;
    position: relative;
    background: var(--portal-bg);
}

/* Hide redundant local headers inside modules */
.main-content header, #view-title {
    display: none !important;
}

/* View Spacing & Smoothness */
.view {
    padding: 2.5rem !important;
    animation: viewFadeIn 0.3s ease;
}

@keyframes viewFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.top-bar-left, .top-bar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.portal-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
}

.module-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.portal-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: #f8fafc;
    border-radius: 50px;
    border: 1px solid var(--border);
}

.portal-user span {
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.portal-nav-btn, .portal-logout-btn {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-nav-btn:hover, .portal-logout-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.portal-view {
    min-height: 100vh;
    padding: calc(var(--portal-top-height) + 4rem) 2rem 4rem;
    background: var(--portal-bg);
}

.selector-content {
    max-width: 1000px;
    margin: 0 auto;
}

.selector-header {
    text-align: center;
    margin-bottom: 3rem;
}

.selector-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.selector-header p {
    color: #64748b;
    font-size: 1.1rem;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.module-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.module-card:hover:not(.disabled) {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    border-color: var(--primary-light);
}

.module-icon {
    width: 64px;
    height: 64px;
    background: #f1f5f9;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    transition: all 0.3s;
}

.module-card:hover .module-icon {
    background: var(--primary);
    color: white;
}

.module-info h3 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
}

.module-info p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.module-status {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    background: #f1f5f9;
    color: #94a3b8;
    border-radius: 4px;
    width: fit-content;
}

.module-card.active .module-status {
    background: #dcfce7;
    color: #10b981;
}

.module-card.disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: #f8fafc;
}

.module-card.disabled:grayscale(1) {
    filter: grayscale(1);
}

.sidebar-layout {
    height: 100dvh !important;
}

.badge-count { background: #f1f5f9; color: #475569; padding: 0.3rem 0.75rem; border-radius: 8px; font-size: 0.85rem; font-weight: 600; }
.badge-approved { background: #eff6ff; color: #1d4ed8; padding: 0.3rem 0.75rem; border-radius: 8px; font-size: 0.85rem; font-weight: 600; border: 1px solid #dbeafe; }
.badge-date { background: #f8fafc; color: #94a3b8; padding: 0.3rem 0.75rem; border-radius: 8px; font-size: 0.85rem; font-weight: 400; }
.badge-user { background: #f1f5f9; color: #475569; padding: 0.3rem 0.75rem; border-radius: 8px; font-size: 0.85rem; font-weight: 600; }
.badge-completed { background: #10b981; color: white; padding: 0.3rem 0.75rem; border-radius: 8px; font-size: 0.85rem; font-weight: 700; box-shadow: 0 2px 4px rgba(16,185,129,0.2); }
.badge-ready-erp { background: #8b5cf6; color: white; padding: 0.3rem 0.75rem; border-radius: 8px; font-size: 0.85rem; font-weight: 700; box-shadow: 0 2px 4px rgba(139, 92, 246, 0.2); }
.badge-approved { background: #3b82f6; color: white; padding: 0.3rem 0.75rem; border-radius: 8px; font-size: 0.85rem; font-weight: 700; box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2); }

.btn-erp { background: #3b82f6 !important; }
.btn-completed { background: #10b981 !important; opacity: 0.8 !important; cursor: not-allowed !important; }
.btn-finish-ready { background: #10b981 !important; opacity: 1 !important; cursor: pointer !important; }
.btn-finish-locked { background: #94a3b8 !important; opacity: 0.6 !important; cursor: not-allowed !important; }
.btn-awaiting { background: #64748b !important; opacity: 0.7 !important; cursor: not-allowed !important; }
.btn-reexport { background: #6366f1 !important; opacity: 1 !important; cursor: pointer !important; }
.btn-finalize-ready { background: #4f46e5 !important; opacity: 1 !important; cursor: pointer !important; }
.btn-finalize-locked { background: #94a3b8 !important; opacity: 0.6 !important; cursor: not-allowed !important; }

@media (min-width: 1101px) {
    .req-right-col > .card.glass {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }
}

@media (max-width: 1100px) {
    html, body { 
        overflow-x: hidden !important; 
        overflow-y: auto !important; 
        height: auto !important; 
    }
    .main-content, .view { 
        overflow-y: auto !important; 
        height: auto !important; 
        min-height: 100vh !important;
    }
    .request-detail-grid {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        overflow: visible !important;
        gap: 1.5rem !important;
        padding-bottom: 100px !important;
    }
    .req-left-col, .req-right-col {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }
    .card.glass {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .batch-card-detail {
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 1.25rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        overflow-x: hidden !important;
    }
    #responses-thread {
        max-height: none !important;
        overflow: visible !important;
        height: auto !important;
    }

    .dashboard-secondary-grid {
        grid-template-columns: 1fr !important;
    }

    .detail-stats, .table-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        width: 100% !important;
        overflow: visible !important;
        margin-bottom: 1rem !important;
        justify-content: flex-start !important;
    }
    
    .detail-stats > span, 
    .detail-stats > button,
    .table-actions > button, 
    .table-actions > span {
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .stat-badge, .table-actions button {
        flex: 1 1 calc(50% - 0.5rem) !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        min-width: 120px !important;
        padding: 0.6rem !important;
        font-size: 0.8rem !important;
        gap: 0.5rem !important;
        box-sizing: border-box !important;
    }

    .batch-card-detail .table-header {
        display: flex !important;
        flex-direction: column !important;
        text-align: left !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 0 !important;
        gap: 1rem !important;
        box-sizing: border-box !important;
    }

    .batch-card-detail .back-btn {
        margin: 0 !important;
        display: inline-flex !important;
    }

    .batch-card-detail .batch-title {
        margin: 0 !important;
        text-align: left !important;
        border-left: none !important;
        padding-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        white-space: normal !important;
    }

    .img-cell, .barcode-cell, .name-cell,
    .batch-table thead th.img-cell,
    .batch-table thead th.barcode-cell,
    .batch-table thead th.name-cell,
    .batch-table thead tr.sub-headers th.img-cell,
    .batch-table thead tr.sub-headers th.barcode-cell,
    .batch-table thead tr.sub-headers th.name-cell,
    .batch-table tbody td.img-cell,
    .batch-table tbody td.barcode-cell,
    .batch-table tbody td.name-cell {
        position: static !important;
        box-shadow: none !important;
        transform: none !important;
    }
}

.req-photo-gallery {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)) !important;
    gap: 1.5rem !important;
    width: 100% !important;
}
@media (max-width: 600px) {
    .req-photo-gallery {
        grid-template-columns: 1fr !important;
        gap: 1rem !important; 
    }
    .req-photo-gallery > div {
        aspect-ratio: auto !important;
        max-width: 100% !important;
    }
}
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.nav-badge-item .nav-notify-icon {
    font-size: 0.95rem;
    color: inherit !important;
    margin: 0;
}

.nav-badge-item .badge-count {
    background: transparent;
    color: inherit !important;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 800;
    min-width: unset;
    text-align: left;
    line-height: 1;
    margin: 0;
    margin-left: 1px;
}

.inline-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
}
/* Dashboard Action Items */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.task-item:hover {
    transform: translateX(4px);
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.task-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.task-icon.high { background: #fee2e2; color: #ef4444; }
.task-icon.medium { background: #fef3c7; color: #d97706; }
.task-icon.info { background: #e0f2fe; color: #0284c7; }
.task-icon.ready { background: #f5f3ff; color: #7c3aed; }

.task-content {
    flex: 1;
}

.task-content h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.task-content p {
    margin: 4px 0 0;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* REQUEST LIST SCROLLING */
.requests-container {
    width: 100%;
    height: auto;
}

/* Custom Scrollbar for better aesthetics */
.requests-container::-webkit-scrollbar {
    width: 6px;
}
.requests-container::-webkit-scrollbar-track {
    background: transparent;
}
.requests-container::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
        grid-template-columns: 1fr !important;
        gap: 1rem !important; 
    }
    .req-photo-gallery > div {
        aspect-ratio: auto !important;
        max-width: 100% !important;
    }
}
/* User Management Styles */
#users-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

#users-table th {
    padding: 0; /* Let .th-inner handle padding */
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

#users-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: var(--text-main);
}

#users-table tr:hover td {
    background-color: #f8fafc;
}

#users-table tr:last-child td {
    border-bottom: none;
}


.user-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.user-form-full {
    grid-column: span 2;
}

/* Notifications */
/* --- PMS NAVIGATION BADGES --- */
.nav-badge-container {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 6px;
    flex-shrink: 0;
}

.nav-badge-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-badge-item.task-new {
    background: #f59e0b !important;
    color: white !important;
}

.nav-badge-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    min-width: 24px;
    height: 18px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    border: 1px solid #ffffff;
    line-height: 1;
}

.badge-requests { 
    background: rgba(14, 165, 233, 0.4) !important; 
    color: white !important; 
    border: 1px solid #0ea5e9 !important; 
}

.badge-review { 
    background: rgba(245, 158, 11, 0.4) !important; 
    color: white !important; 
    border: 1px solid #f59e0b !important; 
}

.badge-offers { 
    background: rgba(16, 185, 129, 0.4) !important; 
    color: white !important; 
    border: 1px solid #10b981 !important; 
}

.nav-badge-item .nav-notify-icon {
    font-size: 0.8rem;
    color: inherit !important;
}

.nav-badge-item .badge-count {
    color: inherit !important;
    font-size: 0.8rem;
    font-weight: 800;
}

@keyframes bounceSoft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.card-notify-icon {
    margin-left: auto;
    font-size: 1.2rem;
    padding: 2px;
}

/* Redundant badge-count removed */

.inline-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
}
/* Dashboard Action Items */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.task-item:hover {
    transform: translateX(4px);
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.task-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.task-icon.high { background: #fee2e2; color: #ef4444; }
.task-icon.medium { background: #fef3c7; color: #d97706; }
.task-icon.info { background: #e0f2fe; color: #0284c7; }
.task-icon.low { background: #dcfce7; color: #10b981; }

.task-content {
    flex: 1;
}

.task-content h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.task-content p {
    margin: 4px 0 0;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* REQUEST LIST SCROLLING */
.requests-container {
    width: 100%;
    height: auto;
}

/* Custom Scrollbar for better aesthetics */
.requests-container::-webkit-scrollbar {
    width: 6px;
}
.requests-container::-webkit-scrollbar-track {
    background: transparent;
}
.requests-container::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}
.requests-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Visibility controls based on role */
.role-user-hide {
    display: none !important;
}

body.role-user .js-user-hide {
    display: none !important;
}

/* ==========================================================================
   UNIFIED RESPONSIVE SYSTEM (Mobile & Tablet)
   ========================================================================== */

/* Utility: Responsive Table Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

@media (max-width: 1024px) {
    .sidebar-layout {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 3000;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        background: white !important;
        box-shadow: 20px 0 50px rgba(0,0,0,0.1);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        min-height: 100vh;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        backdrop-filter: blur(4px);
        z-index: 1000;
        display: none;
        opacity: 0;
        transition: var(--transition);
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
}

@media (max-width: 768px) {
    header {
        height: 70px;
        padding: 0 1rem;
    }

    .header-left {
        gap: 1rem;
    }
    
    #view-title {
        font-size: 1.15rem;
    }

    .user-profile {
        padding: 0.4rem 0.6rem;
        background: white;
        box-shadow: var(--shadow-sm);
    }

    .user-profile #current-username {
        display: none; 
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .card {
        padding: 1.25rem;
        border-radius: var(--radius-md);
    }

    .dashboard-secondary-grid {
        grid-template-columns: 1fr !important;
        display: flex;
        flex-direction: column;
        order: 1;
        margin: 0 !important;
        gap: 1rem;
    }

    #dashboard-tasks-container {
        order: 1;
        margin: 0 !important;
    }

    #dashboard-tasks-container + .card {
        order: 2;
        margin: 0 !important;
    }

    #stats-container-dynamic {
        order: 2;
        margin: 0 !important;
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    #dashboard-view {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        width: 100%;
        box-sizing: border-box;
    }

    /* Fixed rounding for mobile views */
    .view {
        padding: 1rem !important;
        box-sizing: border-box;
    }
}

    /* User profile: show on mobile too (we hid username but keep icon) */
    .header-logout-btn {
        padding: 0.5rem !important;
    }
}

/* --- ULTIMATE MODERN USER MANAGEMENT --- */
#users-table {
    border-collapse: separate !important;
    border-spacing: 0 12px !important;
    background: transparent !important;
    width: 100%;
}

#users-table thead th {
    background: transparent !important;
    border: none !important;
    color: var(--text-dim) !important;
    font-size: 0.7rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    padding: 0 1.5rem 0.5rem 1.5rem !important;
    text-align: left !important;
}

#users-table tbody tr {
    background: white !important;
    box-shadow: var(--shadow-soft) !important;
    border-radius: var(--radius) !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
    cursor: default;
}

#users-table tbody tr:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08) !important;
}

#users-table tbody td {
    padding: 1.25rem 1.5rem !important;
    border: none !important;
}

#users-table tbody td:first-child {
    border-radius: var(--radius) 0 0 var(--radius) !important;
}

#users-table tbody td:last-child {
    border-radius: 0 var(--radius) var(--radius) 0 !important;
}

/* Master Badge Gold Edition */
.master-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: white !important;
    font-weight: 800 !important;
    font-size: 0.65rem !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3) !important;
    text-transform: uppercase;
    margin-left: 8px;
}

/* Custom Scrollbar for Main Content */
.main-content::-webkit-scrollbar {
    width: 8px;
}
.main-content::-webkit-scrollbar-track {
    background: var(--bg-main);
}
.main-content::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}
.main-content::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

.user-avatar-small {
    width: 44px !important;
    height: 44px !important;
    font-size: 1rem !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0) !important;
    border: 1px solid white;
}

/* Module Card Notifications */
.module-card {
    position: relative;
}

.card-notif-bar {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 6px 12px;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
    animation: notifSlideIn 0.4s ease;
    z-index: 10;
}

.notif-bar {
    position: absolute;
    top: 20px;
    right: 20px;
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 8px 12px;
    z-index: 10;
}

/* --- Portal & Global Badge Styles (Unified) --- */
.notif-item, .nav-badge-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 0.725rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

/* Theme Colors (Colored Icon/Text Style) */
.badge-requests, #notif-pms-requests { 
    background: #e0f2fe !important; 
    color: #0284c7 !important; 
    border: 1px solid #bae6fd !important; 
}

.badge-review, #notif-pms-review { 
    background: #fef3c7 !important; 
    color: #b45309 !important; 
    border: 1px solid #fde68a !important; 
}

.badge-offers, #notif-pms-offers { 
    background: #dcfce7 !important; 
    color: #059669 !important; 
    border: 1px solid #bbf7d0 !important; 
}

.badge-erp, #notif-pms-erp { 
    background: #ffedd5 !important; 
    color: #9a3412 !important; 
    border: 1px solid #fed7aa !important; 
}

.badge-ready, #notif-pms-ready { 
    background: #f3e8ff !important; 
    color: #6d28d9 !important; 
    border: 1px solid #e9d5ff !important; 
}

/* Icon & Count Overrides to inherit parent color */
.notif-item i, .nav-badge-item i,
.notif-item .count, .nav-badge-item .badge-count {
    color: inherit !important;
    font-size: 0.85rem;
    font-weight: 800;
}

.notif-item.hidden {
    display: none !important;
}

@keyframes notifSlideIn {
    0% { transform: translateY(-10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Restricted Module Access Styles */
.module-card.restricted {
    opacity: 0.6 !important;
    filter: grayscale(1) !important;
    cursor: not-allowed !important;
    border: 1px dashed var(--border) !important;
    pointer-events: auto !important; /* Allow click to show toast */
}

.module-card.restricted:hover {
    transform: none !important;
    box-shadow: none !important;
}

.module-card.restricted .module-status {
    background: #f1f5f9 !important;
    color: #64748b !important;
}

/* Column Resizer Styles */
.th-inner {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 20px;
}

.resizer {
    position: absolute;
    right: -4px;
    top: 0;
    width: 8px;
    cursor: col-resize;
    user-select: none;
    height: 100%;
    z-index: 10;
}

.resizer:hover {
    background: rgba(59, 130, 246, 0.4);
}

body.resizing {
    cursor: col-resize !important;
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08) !important;
}

#users-table tbody td {
    padding: 1.25rem 1.5rem !important;
    border: none !important;
}

#users-table tbody td:first-child {
    border-radius: var(--radius) 0 0 var(--radius) !important;
}

#users-table tbody td:last-child {
    border-radius: 0 var(--radius) var(--radius) 0 !important;
}

/* Master Badge Gold Edition */
.master-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: white !important;
    font-weight: 800 !important;
    font-size: 0.65rem !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3) !important;
    text-transform: uppercase;
    margin-left: 8px;
}

/* Custom Scrollbar for Main Content */
.main-content::-webkit-scrollbar {
    width: 8px;
}
.main-content::-webkit-scrollbar-track {
    background: var(--bg-main);
}
.main-content::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}
.main-content::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

.user-avatar-small {
    width: 44px !important;
    height: 44px !important;
    font-size: 1rem !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0) !important;
    border: 1px solid white;
}

/* Module Card Notifications */
.module-card {
    position: relative;
}

.card-notif-bar {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 6px 12px;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
    animation: notifSlideIn 0.4s ease;
    z-index: 10;
}

.notif-bar {
    position: absolute;
    top: 20px;
    right: 20px;
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 8px 12px;
    z-index: 10;
}

/* --- Portal & Global Badge Styles (Unified) --- */
.notif-item, .nav-badge-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 0.725rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

/* Theme Colors (Colored Icon/Text Style) */
.badge-requests, #notif-pms-requests { 
    background: #e0f2fe !important; 
    color: #0284c7 !important; 
    border: 1px solid #bae6fd !important; 
}

.badge-review, #notif-pms-review { 
    background: #fef3c7 !important; 
    color: #b45309 !important; 
    border: 1px solid #fde68a !important; 
}

.badge-offers, #notif-pms-offers { 
    background: #dcfce7 !important; 
    color: #059669 !important; 
    border: 1px solid #bbf7d0 !important; 
}

.badge-erp, #notif-pms-erp { 
    background: #ffedd5 !important; 
    color: #9a3412 !important; 
    border: 1px solid #fed7aa !important; 
}

.badge-ready, #notif-pms-ready { 
    background: #f3e8ff !important; 
    color: #6d28d9 !important; 
    border: 1px solid #e9d5ff !important; 
}

/* Icon & Count Overrides to inherit parent color */
.notif-item i, .nav-badge-item i,
.notif-item .count, .nav-badge-item .badge-count {
    color: inherit !important;
    font-size: 0.85rem;
    font-weight: 800;
}

.notif-item.hidden {
    display: none !important;
}

@keyframes notifSlideIn {
    0% { transform: translateY(-10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Restricted Module Access Styles */
.module-card.restricted {
    opacity: 0.6 !important;
    filter: grayscale(1) !important;
    cursor: not-allowed !important;
    border: 1px dashed var(--border) !important;
    pointer-events: auto !important; /* Allow click to show toast */
}

.module-card.restricted:hover {
    transform: none !important;
    box-shadow: none !important;
}

.module-card.restricted .module-status {
    background: #f1f5f9 !important;
    color: #64748b !important;
}

/* Column Resizer Styles */
.th-inner {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 20px;
}

.resizer {
    position: absolute;
    right: -4px;
    top: 0;
    width: 8px;
    cursor: col-resize;
    user-select: none;
    height: 100%;
    z-index: 10;
}

.resizer:hover {
    background: rgba(59, 130, 246, 0.4);
}

body.resizing {
    cursor: col-resize !important;
}
body.resizing * {
    user-select: none !important;
}
/* Ensure .hidden always wins */
.hidden {
    display: none !important;
}

/* Premium Role Badges */
.premium-role-badge {
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.role-admin {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.role-manager {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.role-user {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.role-shop {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ============================================================
   COLUMN VISIBILITY SETTINGS (v52)
   ============================================================ */

/* Column Visibility Dropdown - Premium Redesign */
.column-settings-container {
    position: relative;
    display: inline-block;
}

.column-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    max-height: 500px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 5000;
    display: none;
    padding: 8px 0;
    margin-top: 10px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
    animation: dropdownFadeIn 0.2s ease-out;
}

.column-dropdown.show {
    display: block;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.column-dropdown::-webkit-scrollbar {
    width: 6px;
}

.column-dropdown::-webkit-scrollbar-track {
    background: #f8fafc;
}

.column-dropdown::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.column-section-header {
    padding: 10px 16px 4px 16px;
    font-size: 0.65rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    margin-top: 4px;
}

.column-option-item {
    padding: 0;
}

.column-option-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #334155;
    transition: background 0.15s ease;
    user-select: none;
}

.column-option-item label:hover {
    background: #f1f5f9;
    color: #4f46e5;
}

.column-option-item input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #4f46e5;
    cursor: pointer;
    margin: 0;
}

.column-option-item.sub-option label {
    padding-left: 36px;
}

.column-option-item.sub-option label span {
    font-size: 0.8rem;
    color: #64748b;
}

.column-option-item.sub-option label:hover span {
    color: #4f46e5;
}

.dropdown-footer {
    padding: 12px 16px;
    border-top: 1px solid #f1f5f9;
    margin-top: 4px;
    display: flex;
    justify-content: flex-end;
}

.btn-reset-cols {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset-cols:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Simple Column Hiding - Target cells directly */
.hide-img-cell .img-cell { display: none !important; }
.hide-barcode-cell .barcode-cell { display: none !important; }
.hide-name-cell .name-cell { display: none !important; }
.hide-unit-cell .unit-cell { display: none !important; }
.hide-pal-vnt-cell .pal-vnt-cell { display: none !important; }
.hide-exp-cell .exp-cell { display: none !important; }
.hide-price-xls-cell .price-xls-cell { display: none !important; }
.hide-notes-cell .notes-cell { display: none !important; }
.hide-calc-unit-1000-cell .calc-unit-1000-cell { display: none !important; }
.hide-calc-trans-cell .calc-trans-cell { display: none !important; }

.hide-buy-price-old-cell .buy-price-old-cell { display: none !important; }
.hide-buy-price-new-cell .buy-price-new-cell { display: none !important; }

.hide-cost-pal-cell .cost-pal-cell { display: none !important; }
.hide-cost-for-cell .cost-for-cell { display: none !important; }
.hide-cost-sugar-cell .cost-sugar-cell { display: none !important; }

.hide-s1-pal-cell .s1-pal-cell { display: none !important; }
.hide-s1-for-cell .s1-for-cell { display: none !important; }
.hide-s1-markup-pal-cell .s1-markup-pal-cell { display: none !important; }
.hide-s1-markup-for-cell .s1-markup-for-cell { display: none !important; }

.hide-s1-price-old-cell .s1-price-old-cell { display: none !important; }
.hide-tp-s1-cell .tp-s1-cell { display: none !important; }

.hide-maxela-cell .maxela-cell { display: none !important; }
.hide-polonez-cell .polonez-cell { display: none !important; }

.hide-final-shop-asort-cell .final-shop-asort-cell { display: none !important; }
.hide-tp-profit-pal-cell .tp-profit-pal-cell { display: none !important; }
.hide-final-shop-uzsak-calc-cell .final-shop-uzsak-calc-cell { display: none !important; }
.hide-final-shop-uzsak-shop-cell .final-shop-uzsak-shop-cell { display: none !important; }

.hide-shop-price-old-cell .shop-price-old-cell { display: none !important; }
.hide-final-shop-cell .final-shop-cell { display: none !important; }
.hide-tp-profit-for-cell .tp-profit-for-cell { display: none !important; }

.hide-erp-type-cell .erp-type-cell { display: none !important; }
.hide-erp-type-shops-cell .erp-type-shops-cell { display: none !important; }
.hide-suggested-type-cell .suggested-type-cell { display: none !important; }

/* =====================================================================
   GROUP- CLASS ALIASES (mirrors of header-group- for new unified naming)
   Only th elements are styled — data rows (td) remain uncolored.
   ===================================================================== */

th.group-purchase     { background-color: #fef2f2 !important; color: #9a3412 !important; border-right: 1px solid rgba(239, 68, 68, 0.3) !important;   box-shadow: inset 0 -3px 0 #ef4444, inset 0 -1px 0 #e2e8f0 !important; }
th.group-cost         { background-color: #f0fdf4 !important; color: #166534 !important; border-right: 1px solid rgba(34, 197, 94, 0.3) !important;   box-shadow: inset 0 -3px 0 #22c55e, inset 0 -1px 0 #e2e8f0 !important; }
th.group-s1-pricing   { background-color: #eff6ff !important; color: #1e40af !important; border-right: 1px solid rgba(59, 130, 246, 0.3) !important;   box-shadow: inset 0 -3px 0 #3b82f6, inset 0 -1px 0 #e2e8f0 !important; }
th.group-s1-price     { background-color: #eff6ff !important; color: #1e40af !important; border-right: 1px solid rgba(59, 130, 246, 0.3) !important;   box-shadow: inset 0 -3px 0 #3b82f6, inset 0 -1px 0 #e2e8f0 !important; }
th.group-tradepro     { background-color: #eff6ff !important; color: #1e40af !important; border-right: 1px solid rgba(59, 130, 246, 0.3) !important;   box-shadow: inset 0 -3px 0 #3b82f6, inset 0 -1px 0 #e2e8f0 !important; }
th.group-comp         { background-color: #fff1f2 !important; color: #9f1239 !important; border-right: 1px solid rgba(251, 113, 133, 0.3) !important;  box-shadow: inset 0 -3px 0 #fb7185, inset 0 -1px 0 #e2e8f0 !important; }
th.group-shop-pricing { background-color: #fffbeb !important; color: #92400e !important; border-right: 1px solid rgba(245, 158, 11, 0.3) !important;   box-shadow: inset 0 -3px 0 #f59e0b, inset 0 -1px 0 #e2e8f0 !important; }
th.group-shop-price   { background-color: #fffbeb !important; color: #92400e !important; border-right: 1px solid rgba(245, 158, 11, 0.3) !important;   box-shadow: inset 0 -3px 0 #f59e0b, inset 0 -1px 0 #e2e8f0 !important; }
th.group-erp          { background-color: #eef2ff !important; color: #1e40af !important; border-right: 1px solid rgba(99, 102, 241, 0.3) !important;   box-shadow: inset 0 -3px 0 #6366f1, inset 0 -1px 0 #e2e8f0 !important; }



/* --- COLUMN SELECTOR MODAL --- */
.pms-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden; /* Prevent overlay from scrolling */
}

.pms-modal-overlay.show {
    display: flex;
}

.pms-modal-overlay .column-dropdown {
    position: relative !important;
    display: flex !important; /* Use flex to control internal scroll */
    flex-direction: column;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 2rem;
    overflow-y: auto; /* Internal scroll */
    left: auto !important;
    top: auto !important;
    margin: 0 auto;
}

/* Styled internal scrollbar */
.pms-modal-overlay .column-dropdown::-webkit-scrollbar {
    width: 6px;
}
.pms-modal-overlay .column-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.pms-modal-overlay .column-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.pms-modal-overlay .column-dropdown::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.modal-close-btn {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s;
    z-index: 10;
}

.modal-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

@media (max-width: 600px) {
    .pms-modal-overlay .column-dropdown {
        padding: 1.5rem;
        max-height: 90vh;
    }
}

/* --- NEW PREMIUM MODAL UI (MATCHING PHOTO) --- */
.modal-header-pms {
    margin-bottom: 1.5rem;
}
.modal-header-pms h2 {
    color: #6366f1;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}
.modal-header-pms p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
}

.modal-subheader-pms {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}
.target-label {
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
}
.quick-actions button {
    background: none;
    border: none;
    color: #6366f1;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    margin-left: 1rem;
}
.quick-actions button:hover {
    text-decoration: underline;
}

.column-section-header-pms {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 0 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.column-option-item-pms {
    border-bottom: 1px solid #f1f5f9;
}
.column-option-item-pms label {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    gap: 12px;
}
.column-option-item-pms label:hover {
    background: #f8fafc;
}

/* Custom Checkbox Style */
.column-option-item-pms input[type='checkbox'] {
    display: none;
}
.custom-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    position: relative;
    transition: all 0.2s;
    background: white;
}
.column-option-item-pms input[type='checkbox']:checked + .custom-checkbox {
    background: #6366f1;
    border-color: #6366f1;
}
.column-option-item-pms input[type='checkbox']:checked + .custom-checkbox::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 10px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.option-label {
    font-size: 0.95rem;
    color: #334155;
    font-weight: 500;
}

.modal-footer-pms {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}
.btn-cancel {
    background: #f1f5f9;
    color: #475569;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-save {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
.btn-save:hover {
    background: #059669;
    transform: translateY(-1px);
}


/* --- FINAL MODAL UI MATCHING REFERENCE --- */
.pms-modal-overlay .column-dropdown {
    display: flex !important;
    flex-direction: column;
    padding: 2.5rem !important;
    overflow: hidden !important; /* Modal itself doesn't scroll anymore */
}

.modal-header-pms {
    flex-shrink: 0;
    margin-bottom: 2rem !important;
}

.modal-body-pms {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0;
    margin-bottom: 1rem;
    background: white;
}

/* Thick scrollbar matching reference */
.modal-body-pms::-webkit-scrollbar {
    width: 14px;
}
.modal-body-pms::-webkit-scrollbar-track {
    background: #f8fafc;
    border-left: 1px solid #e2e8f0;
}
.modal-body-pms::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border: 2px solid #f8fafc;
    border-radius: 10px;
}
.modal-body-pms::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.modal-subheader-pms {
    position: sticky;
    top: 0;
    z-index: 5;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    border-bottom: 1px solid #e2e8f0;
}

.column-options-list {
    padding: 0 1rem;
}

.modal-footer-pms {
    flex-shrink: 0;
    margin-top: 1rem !important;
}

.btn-cancel, .btn-save {
    padding: 12px 32px !important;
    font-size: 1rem !important;
    border-radius: 16px !important;
}

.btn-cancel {
    background: #f1f5f9 !important;
}
.btn-save {
    background: #10b981 !important;
}


#mapping-fields { max-height: 60vh; overflow-y: auto; padding-right: 0.5rem; }

.btn-batch-delete:hover { color: #ef4444 !important; transform: scale(1.1); transition: all 0.2s; }


/* Dashboard Scrolling Overrides (Desktop Only) */
.tasks-list, .requests-grid { 
    max-height: calc(100vh - 450px) !important; /* Dinamiškai prisitaiko prie lango aukščio */
    min-height: 200px;
    overflow-y: auto !important; 
    padding-right: 8px !important; 
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.tasks-list::-webkit-scrollbar, .requests-grid::-webkit-scrollbar {
    width: 6px;
}

.tasks-list::-webkit-scrollbar-track, .requests-grid::-webkit-scrollbar-track {
    background: transparent;
}

.tasks-list::-webkit-scrollbar-thumb, .requests-grid::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.tasks-list::-webkit-scrollbar-thumb:hover, .requests-grid::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
.request-dashboard-item { display: flex; align-items: center; gap: 1rem; padding: 0.85rem 1rem; background: white; border: 1px solid var(--border); border-radius: 12px; transition: all 0.2s ease; cursor: pointer; }
.request-dashboard-item:hover { transform: translateX(4px); border-color: var(--primary-light); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08); }




