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

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

/* 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; /* Hide scrollbar for Firefox */
}

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

.masters-tabs-content {
    display: inline-flex;
    align-items: center;
    height: 100%;
    padding: 0 16px;
    gap: 8px;
    position: relative; /* Base for horizontal line */
    min-width: 100%;
    box-sizing: border-box;
}

/* Continuous horizontal grey line under all tabs */
.masters-tabs-content::after {
    content: '';
    position: absolute;
    bottom: 9px; /* Aligns exactly with the bottom of the centered tab buttons */
    left: 16px;
    right: 16px;
    height: 1px;
    background-color: #e2e8f0;
    z-index: 1;
}

.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 {
    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: #cbd5e1;
}

.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: 4px;
    padding: 0 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s, filter 0.15s;
    white-space: nowrap;
}

.add-customer-btn:hover {
    background-color: var(--primary-color);
    filter: brightness(90%);
}

/* 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;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.import-btn:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

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

/* Table Design */
.masters-table-wrapper {
    background-color: #ffffff;
    border-radius: 6px;
    border: 1px solid #e1e5ea;
    overflow-x: auto;
    box-sizing: border-box;
}

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

.masters-table th {
    background-color: #f8fafc;
    color: #555555;
    font-weight: 500;
    padding: 10px 12px;
    border-bottom: 1px solid #e1e5ea;
    white-space: nowrap;
    height: 45px;
    box-sizing: border-box;
    text-align: center;
}

.masters-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 {
    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;
}


.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;
    transition: background-color 0.15s, border-color 0.15s;
    box-sizing: border-box;
}

.action-view-btn:hover {
    background-color: #fee2e2;
    border-color: #f87171;
}

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

.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;
    transition: background-color 0.15s, border-color 0.15s;
    box-sizing: border-box;
}

.action-delete-btn:hover {
    background-color: #fee2e2;
    border-color: #ef4444;
}

.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;
    transition: background-color 0.15s, border-color 0.15s;
    box-sizing: border-box;
}

.action-edit-btn:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

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

/* 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;
}

.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);
    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;
}
