/* Customer Master Page Styles - Figma Dimensions (1920x1080) */

.masters-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333333;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
}

/* Tabs Navigation Wrapper */
.masters-tabs-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.masters-tabs-wrapper .masters-tabs-row {
    flex: 1;
    min-width: 0;
}

/* Tabs Navigation Row */
.masters-tabs-row {
    background-color: #ffffff;
    border-radius: 6px;
    border: 1px solid #d9e0e7;
    height: 50px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.masters-tabs-row::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Arrow Navigation Button with proper background & shadow */
.tab-arrow-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: 1px solid #d9e0e7;
    border-radius: 8px;
    color: #4a5568;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    user-select: none;
    outline: none;
}

.tab-arrow-btn:hover:not(.disabled) {
    background-color: #f8fafc;
    color: var(--primary-color);
    border-color: #cbd5e1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.tab-arrow-btn:active:not(.disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tab-arrow-btn.disabled {
    opacity: 0.35;
    cursor: default;
    box-shadow: none;
    background-color: #f8fafc;
    border-color: #e2e8f0;
}

.masters-tabs-content {
    display: inline-flex !important;
    align-items: center !important;
    height: 100% !important;
    padding: 0 16px !important;
    gap: 8px !important;
    position: relative !important;
    width: max-content !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

/* Continuous horizontal line under all tabs (simple minor grey colored border from 1st tab to end tab) */
.masters-tabs-content::after {
    content: '' !important;
    position: absolute !important;
    bottom: 9px !important;
    left: 16px !important;
    right: 16px !important;
    width: calc(100% - 32px) !important;
    height: 1px !important;
    background-color: #e2e8f0 !important;
    opacity: 1 !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

.branch-hajipur .masters-tabs-content::after,
[data-branch="hajipur"] .masters-tabs-content::after,
.branch-santej .masters-tabs-content::after,
.branch-rakanpur .masters-tabs-content::after,
[data-branch="santej"] .masters-tabs-content::after {
    background-color: #e2e8f0 !important;
    opacity: 1 !important;
}

.tab-btn {
    height: 32px;
    padding: 0 18px;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    /* Sits above the continuous grey line */
    text-decoration: none;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color) !important;
    font-weight: 600;
    background-color: var(--primary-bg);
    border-radius: 6px;
}

/* Red line at the bottom of the active tab pill, overlapping the grey line */
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 0 0 6px 6px;
    z-index: 3;
}

/* Filter Row Section */
.masters-filter-row,
.locations-filter-row,
.locations-search-row,
.ip-filter-row,
.role-filter-row,
.user-filter-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    background-color: #ffffff;
    padding: 10px 16px;
    border-radius: 6px;
    border: 1px solid #d9e0e7;
    box-sizing: border-box;
    align-items: center;
    height: 65px;
    width: 100%;
}

.filter-spacer {
    flex: 1;
}

.filter-item {
    width: 260px;
    min-width: 0;
    position: relative;
    box-sizing: border-box;
}

.filter-select {
    width: 100%;
    height: 36px;
    padding: 0 28px 0 10px;
    font-size: 12px;
    color: #555555;
    background-color: #ffffff;
    border: 1px solid #d9e0e7;
    border-radius: 4px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    box-sizing: border-box;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.filter-select:focus {
    outline: none;
    border-color: #9CA3AF;
    box-shadow: 0 0 0 2px rgba(108, 117, 125, 0.2);
}

.filter-chevron {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    color: #999999;
}

.filter-chevron svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
}

/* Add Customer Button */
.add-customer-btn {
    height: 36px;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 0 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.add-customer-btn:hover {
    background-color: var(--primary-color);
    filter: brightness(95%);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.12), 0 2px 4px -2px rgba(0, 0, 0, 0.08);
}

.add-customer-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Import Button */
.import-btn {
    height: 36px;
    background-color: #ffffff;
    border: 1px solid #d9e0e7;
    color: #1A1D2D;
    padding: 0 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.import-btn:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.import-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.import-btn svg {
    width: 16px;
    height: 16px;
    stroke: #1A1D2D;
    fill: none;
    stroke-width: 2;
}

/* Table Design */
.masters-table-wrapper,
.locations-card,
.ip-card,
.role-card,
.user-card {
    background-color: #ffffff;
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    overflow-x: auto;
    box-sizing: border-box;
}


.masters-table,
.locations-table,
.ip-table,
.role-table,
.user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    text-align: center;
}

.masters-table th,
.locations-table th,
.ip-table th,
.role-table th,
.user-table th {
    background-color: var(--page-bg, #F2F2F2) !important;
    color: #555555 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-style: normal !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 10px 12px;
    border-bottom: 1px solid #e1e5ea !important;
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: inset 0 -1px 0 #E2E8F0;
    white-space: nowrap;
    height: 45px;
    box-sizing: border-box;
    text-align: center;
}

.masters-table tbody tr,
.locations-table tbody tr,
.ip-table tbody tr,
.role-table tbody tr,
.user-table tbody tr {
    transition: background-color 0.15s ease;
}

.masters-table tbody tr:hover:not(:has(.no-data)):not(:has(td[colspan])),
.locations-table tbody tr:hover:not(:has(.no-data)):not(:has(td[colspan])),
.ip-table tbody tr:hover:not(:has(.no-data)):not(:has(td[colspan])),
.role-table tbody tr:hover:not(:has(.no-data)):not(:has(td[colspan])),
.user-table tbody tr:hover:not(:has(.no-data)):not(:has(td[colspan])) {
    background-color: #F8FAFC;
}

.masters-table td,
.locations-table td,
.ip-table td,
.role-table td,
.user-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #151515;
    white-space: nowrap;
    vertical-align: middle;
    height: 50px;
    box-sizing: border-box;
    text-align: center;
}

.masters-table tr:last-child td,
.locations-table tr:last-child td,
.ip-table tr:last-child td,
.role-table tr:last-child td,
.user-table tr:last-child td {
    border-bottom: none;
}

span.col-description,
.col-description {
    display: inline-block;
    max-width: 320px;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    vertical-align: middle;
}

/* Render text exactly as stored, preserving multiple consecutive spaces
   (overrides the default white-space: nowrap on table cells). */
.masters-table td.preserve-spaces {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Customer Master & Color Master Table Column Management */
.customer-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.customer-table-scroll::-webkit-scrollbar {
    height: 6px;
}

.customer-table-scroll::-webkit-scrollbar-track {
    background: #F1F5F9;
}

.customer-table-scroll::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

.customer-table-scroll::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

.customer-table.masters-table-wrapper {
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.customer-table .masters-table {
    table-layout: fixed;
    min-width: 0;
    width: 100%;
}

.color-table .masters-table {
    table-layout: fixed;
    min-width: 900px;
}

.color-table .masters-table th,
.color-table .masters-table td {
    padding: 10px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Customer Master: show full text, wrap instead of truncating */
.customer-table .masters-table td {
    padding: 10px 8px;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    vertical-align: middle;
}

.customer-table .masters-table th {
    padding: 10px 8px;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    vertical-align: middle;
}

.customer-table .masters-table td.customer-date-col,
.customer-table .masters-table th.customer-date-col {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    width: 16% !important;
    min-width: 140px !important;
}

.customer-table .masters-table td.customer-status-col,
.customer-table .masters-table th.customer-status-col {
    white-space: nowrap !important;
    width: 9% !important;
    min-width: 85px !important;
}

/* Branch-specific positional overrides to guarantee proper widths even before recompilation */
.branch-santej .customer-table .masters-table th:nth-child(6),
.branch-santej .customer-table .masters-table td:nth-child(6),
.branch-rakanpur .customer-table .masters-table th:nth-child(6),
.branch-rakanpur .customer-table .masters-table td:nth-child(6),
[data-branch="santej"] .customer-table .masters-table th:nth-child(6),
[data-branch="santej"] .customer-table .masters-table td:nth-child(6) {
    width: 16% !important;
    min-width: 140px !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.branch-santej .customer-table .masters-table th:nth-child(5),
.branch-santej .customer-table .masters-table td:nth-child(5),
.branch-rakanpur .customer-table .masters-table th:nth-child(5),
.branch-rakanpur .customer-table .masters-table td:nth-child(5),
[data-branch="santej"] .customer-table .masters-table th:nth-child(5),
[data-branch="santej"] .customer-table .masters-table td:nth-child(5) {
    width: 9% !important;
    min-width: 85px !important;
    white-space: nowrap !important;
}

.branch-hajipur .customer-table .masters-table th:nth-child(4),
.branch-hajipur .customer-table .masters-table td:nth-child(4),
[data-branch="hajipur"] .customer-table .masters-table th:nth-child(4),
[data-branch="hajipur"] .customer-table .masters-table td:nth-child(4) {
    width: 17% !important;
    min-width: 140px !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.branch-hajipur .customer-table .masters-table th:nth-child(3),
.branch-hajipur .customer-table .masters-table td:nth-child(3),
[data-branch="hajipur"] .customer-table .masters-table th:nth-child(3),
[data-branch="hajipur"] .customer-table .masters-table td:nth-child(3) {
    width: 10% !important;
    min-width: 85px !important;
    white-space: nowrap !important;
}

.customer-table .masters-table th,
.color-table .masters-table th {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-style: normal !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #555555 !important;
}

/* Override preserve-spaces: allow controlled wrapping in name cells only */
.color-table .masters-table td.preserve-spaces {
    white-space: nowrap;
    word-break: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Customer names keep stored spacing but wrap fully */
.customer-table .masters-table td.preserve-spaces {
    white-space: pre-wrap;
    word-break: normal;
    overflow-wrap: break-word;
}

.customer-table .col-email {
    display: table-cell;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

/* Color table: tighten left-aligned cells padding */
.color-table .masters-table th.text-start,
.color-table .masters-table td.text-start {
    padding-left: 10px;
}

/* Sortable table header */
th .sortable-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-style: normal !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: inherit;
    cursor: pointer;
}

th .sortable-header:hover,
th .sortable-header:focus-visible {
    color: #151515;
}

th .sortable-header:focus-visible {
    outline: 2px solid #94a3b8;
    outline-offset: 2px;
}

th .sort-icon {
    font-size: 10px;
    line-height: 1;
}

.masters-table th:last-child.no-data,
.masters-table td:last-child.no-data {
    text-align: center !important;
}


/* Links */
.customer-link {
    color: #0f172a;
    text-decoration: underline;
    text-decoration-color: #cbd5e1;
    text-underline-offset: 2px;
    font-weight: 500;
    cursor: pointer;
}

.customer-link:hover {
    color: #2563eb;
    text-decoration-color: #2563eb;
}

/* Side by side action buttons */
.actions-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.action-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #EAEAEA;
    background-color: #FFFFFF;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.action-view-btn:hover {
    background-color: #eff6ff;
    border-color: #93c5fd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.12);
}

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

.action-view-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: #2563eb;
    stroke-width: 2;
    transition: stroke 0.15s ease;
}

.action-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #EAEAEA;
    background-color: #FFFFFF;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.action-delete-btn:hover {
    background-color: #fee2e2;
    border-color: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.12);
}

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

.action-delete-btn:disabled,
.action-delete-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #f3f4f6;
    border-color: #EAEAEA;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

.action-delete-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: #ef4444;
    stroke-width: 2;
}

.action-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #d9e0e7;
    background-color: #ffffff;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.action-edit-btn:hover {
    background-color: var(--primary-bg, #FFE5E5);
    border-color: var(--primary-color, #FF0000);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(255, 0, 0, 0.12);
}

.action-edit-btn:hover svg {
    stroke: var(--primary-color, #FF0000);
}

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

.action-edit-btn:disabled,
.action-edit-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #f3f4f6;
    border-color: #EAEAEA;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

.action-edit-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: #555555;
    stroke-width: 2;
}

.action-edit-btn:disabled svg,
.action-edit-btn.disabled svg {
    stroke: #9ca3af;
}

/* Pagination Style */
.masters-pagination-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: #ffffff;
    border-top: 1px solid #e1e5ea;
    box-sizing: border-box;
    width: 100%;
    flex-shrink: 0;
}

.pagination-info {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 11px;
    font-weight: 600;
    color: #1a1a1a;
    background-color: #ffffff;
    border: 1px solid #d9e0e7;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.pagination-btn:hover:not(.active):not(.disabled) {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.pagination-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.pagination-btn.disabled {
    color: #cbd5e1;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

.pagination-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
}

.text-start {
    text-align: left !important;
}

/* ================================================================
   CUSTOMER DETAILS DIALOG (cdd-*)
   ================================================================ */
.cdd-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    font-family: inherit;
}

.cdd-modal {
    background: #FFFFFF;
    border-radius: 10px;
    width: 520px;
    max-width: 92vw;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid #E5E5EE;
    overflow: hidden;
    animation: cddFadeIn 0.2s ease-out;
}

@keyframes cddFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cdd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #E5E5EE;
}

.cdd-title {
    font-size: 14px;
    font-weight: 700;
    color: #151515;
    margin: 0;
}

.cdd-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #808080;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.cdd-close-btn:hover {
    color: #151515;
}

.cdd-body {
    padding: 16px 20px;
}

.cdd-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 24px;
    row-gap: 14px;
}

.cdd-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-bottom: 1px solid #F0F0F5;
    padding-bottom: 10px;
}

.cdd-label {
    font-size: 11px;
    font-weight: 600;
    color: #151515;
}

.cdd-value {
    font-size: 12px;
    color: #808080;
    font-weight: 400;
}

.cdd-footer {
    display: flex;
    justify-content: flex-end;
    padding: 12px 20px;
    border-top: 1px solid #E5E5EE;
}

.cdd-btn-close {
    background: #FFFFFF;
    border: 1px solid #E5E5EE;
    border-radius: 6px;
    padding: 6px 24px;
    font-size: 12px;
    font-weight: 600;
    color: #151515;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.cdd-btn-close:hover {
    background-color: #F8F9FA;
    border-color: #D1D5DB;
}

/* ================================================================
   IMPORT TOOLBAR  (import-btn-group)
   ================================================================ */
.import-toolbar-wrapper {
    display: flex;
    align-items: center;
}

.import-btn-group {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Left half — "Import" label + upload icon */
.import-main-btn.cwpl-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    border-right: none;
    border-radius: 4px 0 0 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.15s;
}

.import-main-btn:hover {
    filter: brightness(92%);
}

/* Right half — chevron dropdown trigger */
.import-dropdown-btn.cwpl-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 36px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: filter 0.15s;
}

.import-dropdown-btn:hover {
    filter: brightness(92%);
}


/* Transparent full-screen backdrop to close dropdown on outside click */
.import-dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 990;
}

/* Dropdown menu */
.import-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    background: #ffffff;
    border: 1px solid #d9e0e7;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    z-index: 1000;
    padding: 4px 0;
}

.import-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #333333;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    transition: background-color 0.12s;
}

.import-dropdown-item:hover {
    background-color: var(--primary-bg);
    color: var(--primary-color);
}

.import-dropdown-item svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    flex-shrink: 0;
}

/* ================================================================
   IMPORT DATA MODAL  (idm-*)
   ================================================================ */
.idm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.idm-modal {
    background: #ffffff;
    border-radius: 10px;
    width: 480px;
    max-width: 94vw;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    border: 1px solid #e5e5ee;
    overflow: hidden;
    animation: idmFadeIn 0.18s ease-out;
}

@keyframes idmFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.idm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e5e5ee;
}

.idm-title {
    font-size: 14px;
    font-weight: 700;
    color: #151515;
    margin: 0;
}

.idm-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #808080;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.idm-close-btn:hover {
    color: #151515;
}

.idm-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* File upload zone */
.idm-upload-zone {
    border: 2px dashed #d9e0e7;
    border-radius: 8px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    background: #f8fafc;
    transition: border-color 0.15s, background-color 0.15s;
}

.idm-upload-icon svg {
    width: 36px;
    height: 36px;
    stroke: #000;
    fill: none;
}

.idm-upload-label {
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.idm-upload-hint {
    font-size: 11px;
    color: #94a3b8;
}

.idm-file-name {
    font-size: 12px;
    font-weight: 500;
    color: #151515;
    word-break: break-all;
    text-align: center;
}

/* Validation / error message */
.idm-error {
    font-size: 12px;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    padding: 8px 12px;
}

.idm-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid #e5e5ee;
}

.idm-btn-cancel {
    height: 36px;
    padding: 0 20px;
    font-size: 13px;
    font-weight: 600;
    color: #555555;
    background: #ffffff;
    border: 1px solid #d9e0e7;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.idm-btn-cancel:hover {
    background-color: #f8fafc;
}

.idm-btn-import {
    height: 36px;
    padding: 0 20px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: var(--primary-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: filter 0.15s;
}

.idm-btn-import:hover {
    filter: brightness(90%);
}

.idm-btn-import:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ================================================================
   FAILED IMPORT MODAL  (fim-*)
   ================================================================ */
.fim-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.fim-modal {
    background: #ffffff;
    border-radius: 10px;
    width: 1100px;
    max-width: 96vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    border: 1px solid #e5e5ee;
    overflow: hidden;
    animation: idmFadeIn 0.18s ease-out;
}

/* ── Header ─────────────────────────────────────────────────────── */
.fim-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e5e5ee;
    flex-shrink: 0;
    background: #fff;
}

.fim-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fim-header-icon {
    width: 18px;
    height: 18px;
    stroke: #f59e0b;
    flex-shrink: 0;
}

.fim-title {
    font-size: 14px;
    font-weight: 700;
    color: #151515;
    margin: 0;
}

.fim-close-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
}

.fim-close-btn:hover {
    color: #151515;
}

/* ── Summary bar ─────────────────────────────────────────────────── */
.fim-summary-bar {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    background: #f8fafc;
    border-bottom: 1px solid #e5e5ee;
    flex-shrink: 0;
}

.fim-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    flex: 1;
}

.fim-stat-divider {
    width: 1px;
    background: #e5e5ee;
    align-self: stretch;
    flex-shrink: 0;
}

.fim-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fim-stat-icon svg {
    width: 18px;
    height: 18px;
}

.fim-stat-success .fim-stat-icon {
    background: #dcfce7;
}

.fim-stat-success .fim-stat-icon svg {
    stroke: #16a34a;
}

.fim-stat-error .fim-stat-icon {
    background: #fee2e2;
}

.fim-stat-error .fim-stat-icon svg {
    stroke: #dc2626;
}

.fim-stat-total .fim-stat-icon {
    background: #e0e7ff;
}

.fim-stat-total .fim-stat-icon svg {
    stroke: #4f46e5;
}

.fim-stat-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.fim-stat-number {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
    color: #151515;
}

.fim-stat-success .fim-stat-number {
    color: #16a34a;
}

.fim-stat-error .fim-stat-number {
    color: #dc2626;
}

.fim-stat-total .fim-stat-number {
    color: #4f46e5;
}

.fim-stat-label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

/* ── Section heading ─────────────────────────────────────────────── */
.fim-section-heading {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #dc2626;
    background: #fff;
    border-bottom: 1px solid #fecaca;
    flex-shrink: 0;
}

.fim-section-heading svg {
    width: 14px;
    height: 14px;
    stroke: #dc2626;
    flex-shrink: 0;
}

/* ── Table ───────────────────────────────────────────────────────── */
.fim-body {
    overflow-y: auto;
    overflow-x: auto;
    flex: 1;
}

.fim-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 780px;
}

.fim-table th {
    background: #f8fafc;
    color: #6b7280;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 9px 12px;
    border-bottom: 2px solid #e1e5ea;
    white-space: nowrap;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 1;
}

.fim-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
    vertical-align: middle;
    text-align: left;
}

.fim-row-failed:hover td {
    background: #fffbeb;
}

.fim-table tr:last-child td {
    border-bottom: none;
}

/* Column widths */
.fim-col-row {
    width: 52px;
    text-align: center !important;
}

.fim-col-name {
    width: 140px;
}

.fim-col-company {
    width: 130px;
}

.fim-col-email {
    width: 170px;
}

.fim-col-contact {
    width: 105px;
}

.fim-col-state {
    width: 80px;
}

.fim-col-city {
    width: 80px;
}

.fim-col-reason {
    min-width: 160px;
}

/* Hajipur variant — fixed layout so long values are truncated instead of stretching columns */
.fim-table--fixed {
    table-layout: fixed;
    min-width: 0;
}

.fim-table--fixed .fim-col-row     { width: 60px; }
.fim-table--fixed .fim-col-company { width: 24%; }
.fim-table--fixed .fim-col-email   { width: 24%; }
.fim-table--fixed .fim-col-state   { width: 11%; }
.fim-table--fixed .fim-col-city    { width: 11%; }
.fim-table--fixed .fim-col-reason  { width: auto; min-width: 0; }

/* Show full text: wrap instead of truncating (all locations) */
.fim-table td,
.fim-table th {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.fim-table .fim-cell-text {
    display: block;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: break-word;
}

/* Santej variant — fixed layout with percentage widths so short values
   (state/city) never split mid-word and long values wrap inside their column */
.fim-table--santej {
    table-layout: fixed;
    min-width: 0;
}

.fim-table--santej .fim-col-row     { width: 56px; }
.fim-table--santej .fim-col-name    { width: 15%; }
.fim-table--santej .fim-col-company { width: 15%; }
.fim-table--santej .fim-col-email   { width: 18%; }
.fim-table--santej .fim-col-contact { width: 11%; }
.fim-table--santej .fim-col-state   { width: 8%; }
.fim-table--santej .fim-col-city    { width: 10%; }
.fim-table--santej .fim-col-reason  { width: auto; min-width: 0; }

.fim-table .fim-reason-pill {
    display: inline-block;
    white-space: normal;
    border-radius: 12px;
    line-height: 1.4;
}

/* Truncate long cell text with native tooltip */
.fim-cell-text {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: default;
}

/* Row number badge */
.fim-row-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 5px;
}

/* Amber variant — mirrors the duplicate reason pill */
.fim-row-badge--duplicate {
    color: #b45309;
    background: #fffbeb;
    border-color: #fde68a;
}

/* Reason pill */
.fim-reason-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: #dc2626;
    white-space: nowrap;
}

/* Duplicate / already-exists variant — amber */
.fim-reason-pill--duplicate {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.fim-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid #e5e5ee;
    flex-shrink: 0;
    background: #f8fafc;
}

.fim-footer-hint {
    font-size: 11px;
    color: #9ca3af;
    font-style: italic;
}

.fim-btn-close {
    height: 34px;
    padding: 0 24px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.fim-btn-close:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* ============================================================
   Status badge + toggle — matched to the /role page styling
   (.role-status-badge / .role-toggle in role-based-access.css)
   ============================================================ */
.masters-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    height: 24px;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.masters-status-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}

.masters-status-badge.active {
    background-color: #E8F6ED;
    color: #16A34A;
}

.masters-status-badge.inactive {
    background-color: #f3f4f6;
    color: #6b7280;
}

.masters-toggle {
    position: relative;
    width: 34px;
    height: 18px;
    flex-shrink: 0;
}

.masters-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.masters-toggle-slider {
    position: absolute;
    inset: 0;
    background-color: #d1d5db;
    border-radius: 18px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.masters-toggle input:checked+.masters-toggle-slider {
    background-color: #22c55e;
}

.masters-toggle-slider::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.masters-toggle input:checked+.masters-toggle-slider::before {
    transform: translateX(16px);
}

.masters-toggle input:disabled+.masters-toggle-slider,
.masters-toggle.disabled .masters-toggle-slider,
.masters-toggle.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}