/* ==========================================================================
   PrintDeck - Settlements Page Styles (Modular & Scoped)
   Follows Razorpay / Stripe enterprise FinTech design patterns.
   ========================================================================== */

/* Main Container */
.setl-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

/* --------------------------------------------------------------------------
   Bank Account Notification / Info Banner
   -------------------------------------------------------------------------- */
.setl-bank-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 24px;
    font-size: 13.5px;
    color: #334155;
}

.setl-bank-banner-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setl-bank-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #e2e8f0;
    color: #475569;
}

.setl-verified-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 12px;
    background: #dcfce7;
    color: #15803d;
    margin-left: 6px;
}

.setl-manage-bank-link {
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.15s ease;
}

.setl-manage-bank-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Overview Header
   -------------------------------------------------------------------------- */
.setl-overview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.setl-overview-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setl-overview-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.3px;
}

.setl-updated-time {
    font-size: 13px;
    color: #64748b;
    font-weight: 400;
}

.setl-refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.setl-refresh-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
}

.setl-refresh-btn.spinning svg {
    animation: setl-spin 0.8s linear infinite;
}

@keyframes setl-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Overview 3-Card Hero Grid (Razorpay Style)
   -------------------------------------------------------------------------- */
.setl-overview-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: grid;
    grid-template-columns: 1fr 1fr 1.15fr;
    padding: 24px;
    gap: 24px;
    margin-bottom: 32px;
}

/* Individual Columns */
.setl-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
}

.setl-col-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.setl-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.setl-badge-green {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.setl-badge-amber {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fef3c7;
}

.setl-badge-blue {
    background: #eff6ff;
    color: #2563eb;
    border: 1px dashed #bfdbfe;
}

.setl-col-title-wrap {
    display: flex;
    flex-direction: column;
}

.setl-col-title {
    font-size: 14.5px;
    font-weight: 600;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

.setl-col-title.clickable:hover {
    color: #2563eb;
    cursor: pointer;
}

.setl-col-sub {
    font-size: 12.5px;
    color: #64748b;
    margin-top: 2px;
}

.setl-col-body {
    margin-top: auto;
    padding-top: 12px;
}

.setl-amount-val {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.setl-amount-subtext {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Dotted Underline Links (Razorpay UI standard) */
.setl-dotted-link {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 500;
    color: #334155;
    text-decoration: underline dotted #94a3b8;
    text-underline-offset: 4px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    transition: all 0.15s ease;
}

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

/* Holiday / Alert Pill */
.setl-alert-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: #b45309;
    text-decoration: underline dotted #d97706;
    text-underline-offset: 3px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.setl-alert-pill:hover {
    color: #92400e;
    text-decoration-color: #92400e;
}

/* Available Balance Column (Rightmost with Left Divider) */
.setl-col-balance {
    border-left: 1px solid #e2e8f0;
    padding-left: 28px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.setl-balance-label {
    font-size: 16px;
    font-weight: 500;
    color: #475569;
    text-decoration: underline dotted #94a3b8;
    text-underline-offset: 4px;
    cursor: help;
    display: inline-block;
    user-select: none;
}

/* Custom Razorpay-Style Tooltip Popup */
.setl-tooltip-wrap {
    position: relative;
    display: inline-block;
    width: fit-content;
    margin-bottom: 12px;
}

.setl-tooltip-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 280px;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 400;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 100;
    pointer-events: none;
}

.setl-tooltip-arrow {
    position: absolute;
    top: -6px;
    left: 20px;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    border-left: 1px solid #e2e8f0;
    transform: rotate(45deg);
}

.setl-tooltip-wrap:hover .setl-tooltip-popup,
.setl-tooltip-wrap:focus-within .setl-tooltip-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.setl-balance-val {
    font-size: 45px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.9px;
    line-height: 1.1;
}

.setl-balance-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
}

/* --------------------------------------------------------------------------
   Settlements Table & Management Section
   -------------------------------------------------------------------------- */
.setl-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.setl-section-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}

/* Filter Controls Container */
.setl-controls-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.setl-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 12px;
}

/* Filter Tabs */
.setl-tabs {
    display: inline-flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
    gap: 2px;
}

.setl-tab {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.setl-tab.active {
    background: #ffffff;
    color: #0f172a;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.setl-tab:hover:not(.active) {
    color: #0f172a;
}

/* Search & Actions */
.setl-actions-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setl-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.setl-search-icon {
    position: absolute;
    left: 10px;
    color: #94a3b8;
    pointer-events: none;
}

.setl-search-input {
    padding: 7px 12px 7px 32px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
    outline: none;
    width: 220px;
    transition: border-color 0.15s ease;
}

.setl-search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.setl-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}

.setl-export-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

/* --------------------------------------------------------------------------
   Table Layout (Strict 52px Razorpay Row Standard)
   -------------------------------------------------------------------------- */
.setl-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.setl-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13.5px;
    color: #334155;
}

.setl-table th {
    background: #ffffff;
    color: #64748b;
    font-weight: 500;
    font-size: 13px;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.setl-th-info {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 3px;
    color: #94a3b8;
    cursor: help;
}

.setl-table td {
    height: 52px;
    padding: 0 18px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    white-space: nowrap;
    font-size: 13.5px;
}

.setl-table tbody tr {
    transition: background-color 0.15s ease;
}

.setl-table tbody tr:hover {
    background-color: #f8fafc;
}

/* 1. Created Date */
.setl-created-date {
    color: #1e293b;
    font-weight: 400;
}

/* 2. Cell with Copy Button (ID & UTR) */
.setl-cell-with-copy {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.setl-id-link {
    color: #1e293b;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease;
}

.setl-id-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.setl-utr-text {
    color: #475569;
    font-family: inherit;
    font-weight: 400;
}

.setl-copy-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.setl-copy-btn:hover {
    color: #2563eb;
    background: #f1f5f9;
}

/* 3. Net Settlement */
.setl-net-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.setl-net-val {
    color: #0f172a;
    font-weight: 600;
    font-size: 13.5px;
}

.setl-decimal {
    font-size: 11.5px;
    font-weight: 500;
    color: #64748b;
}

.setl-info-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.setl-info-btn:hover {
    color: #2563eb;
    background: #eff6ff;
}

/* 4. Status Pill Badge (Razorpay Style) */
.setl-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 16px;
    line-height: 1.2;
}

.setl-status-pill.processed {
    background: #ecfdf5;
    border: 1px solid #d1fae5;
    color: #059669;
}

.setl-status-pill.processing,
.setl-status-pill.scheduled {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #2563eb;
}

.setl-status-pill.failed {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #dc2626;
}

/* Copy UTR */
.setl-utr-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: monospace;
    font-size: 13px;
    color: #0f172a;
}

.setl-copy-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.setl-copy-btn:hover {
    color: #2563eb;
}

/* Breakup Action Button */
.setl-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 500;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 5px 11px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.setl-action-btn:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

/* --------------------------------------------------------------------------
   Table Pagination Footer
   -------------------------------------------------------------------------- */
.setl-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #ffffff;
    font-size: 13px;
    color: #64748b;
}

.setl-page-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.setl-page-btn {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}

.setl-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.setl-page-btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* --------------------------------------------------------------------------
   Amount Breakup Modal / Side Drawer
   -------------------------------------------------------------------------- */
.setl-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.setl-drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.setl-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    max-width: 90vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.setl-drawer.open {
    transform: translateX(0);
}

.setl-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.setl-drawer-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}

.setl-drawer-close {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.15s ease;
}

.setl-drawer-close:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.setl-drawer-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Breakup Cards Inside Drawer */
.setl-breakup-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 24px;
}

.setl-breakup-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    padding: 6px 0;
    color: #475569;
}

.setl-breakup-row.total {
    border-top: 1px dashed #cbd5e1;
    margin-top: 8px;
    padding-top: 10px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.setl-breakup-row .negative {
    color: #dc2626;
}

/* Skeleton Loading Helpers */
.setl-skeleton {
    display: inline-block;
    height: 14px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: setl-shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes setl-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .setl-overview-card {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .setl-col-balance {
        border-left: none;
        border-top: 1px solid #e2e8f0;
        padding-left: 0;
        padding-top: 20px;
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .setl-overview-card {
        grid-template-columns: 1fr;
        padding: 18px;
    }
    
    .setl-col-balance {
        grid-column: span 1;
    }
    
    .setl-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .setl-search-input {
        width: 100%;
    }
}

