/* Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
    padding: 40px 20px;
}

.login-container {
    width: 100%;
    max-width: 480px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 48px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-card h1 {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    text-align: center;
}

.login-subtitle {
    text-align: center;
    color: var(--text-gray);
    margin-bottom: 32px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-help {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.8;
}

.login-help a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.login-help a:hover {
    text-decoration: underline;
}

.demo-credentials {
    margin-top: 24px;
    padding: 16px;
    background: #fef3c7;
    border-radius: 8px;
    text-align: center;
}

.demo-credentials small {
    color: #92400e;
}

/* OAuth Buttons */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.btn-google {
    background: white;
    color: #3c4043;
    border-color: #dadce0;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #4285f4;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.2);
}

.btn-microsoft {
    background: white;
    color: #3c4043;
    border-color: #dadce0;
}

.btn-microsoft:hover {
    background: #f8f9fa;
    border-color: #00a4ef;
    box-shadow: 0 2px 8px rgba(0, 164, 239, 0.2);
}

.oauth-icon {
    flex-shrink: 0;
}

/* Login Divider */
.login-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.login-divider span {
    padding: 0 16px;
    font-size: 13px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Portal Screen */
.portal-screen {
    min-height: 100vh;
    background: var(--bg-light);
}

/* Portal Layout with Sidebar */
.portal-layout {
    display: flex;
    min-height: 100vh;
    background: #f8fafc;
}

/* Hide navbar completely on portal pages - sidebar replaces it */
body:has(.portal-layout) .navbar {
    display: none;
}

/* Sidebar - Full height, starts at top */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1001;
    transition: transform 0.3s ease;
}

/* Mobile sidebar behavior */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
}

/* Desktop sidebar - always visible */
@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0) !important;
    }
    
    .main-content {
        margin-left: 260px !important;
    }
}


.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 70px; /* Match old navbar height for consistency */
    display: flex;
    align-items: center;
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.sidebar-header .logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.sidebar-header .logo-text-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-header .portal-name {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logo-icon-svg {
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 0;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: rgba(5, 150, 105, 0.15);
    color: #10b981;
    border-left-color: #10b981;
}

.nav-icon-svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item:hover .nav-icon-svg,
.nav-item.active .nav-icon-svg {
    opacity: 1;
}

.nav-text {
    font-size: 15px;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.logout-btn:hover {
    color: #f87171;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}


/* Content Header */
.content-header {
    background: white;
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid #e2e8f0;
}

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

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #64748b;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.wallet-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-radius: 8px;
    color: white;
}

.wallet-balance svg {
    flex-shrink: 0;
}

.balance-amount {
    font-weight: 600;
    font-size: 15px;
}

/* Add Funds Button */
.add-funds-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 2px solid #10b981;
    border-radius: 8px;
    color: #10b981;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-funds-btn:hover {
    background: #10b981;
    color: white;
}

.add-funds-btn:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
    opacity: 0.6;
}

.add-funds-btn:disabled:hover {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
}

.add-funds-btn svg {
    flex-shrink: 0;
}

/* Tab Content Area */
.tab-content-area {
    padding: 32px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-header {
    margin-bottom: 24px;
}

.tab-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.tab-description {
    font-size: 14px;
    color: var(--text-gray);
}

/* Accounting Tab Styles */
.accounting-overview {
    margin-bottom: 32px;
}

.accounting-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.accounting-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.accounting-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.accounting-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.accounting-stat {
    padding: 24px;
    text-align: center;
    border-right: 1px solid #e2e8f0;
}

.accounting-stat:last-child {
    border-right: none;
}

.accounting-stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 8px;
}

.accounting-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.accounting-stat-value.positive {
    color: #059669;
}

/* Transaction Types */
.transaction-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.transaction-type.credit {
    background: #dcfce7;
    color: #166534;
}

.transaction-type.debit {
    background: #fef3c7;
    color: #92400e;
}

.amount-credit {
    color: #059669;
    font-weight: 600;
}

.amount-debit {
    color: #dc2626;
    font-weight: 600;
}

/* Status badges for campaign cases */
.status-signed {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: #dcfce7;
    color: #166534;
}

.status-verified {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: #dbeafe;
    color: #1e40af;
}

.status-returned {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
}

.status-canceled {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: #fee2e2;
    color: #991b1b;
}

.status-pending {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: #f3f4f6;
    color: #4b5563;
}

.section-title-simple {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-link {
    background: none;
    border: none;
    color: #059669;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .tab-content-area {
        padding: 24px;
    }

    .accounting-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .accounting-stat {
        border-bottom: 1px solid #e2e8f0;
    }

    .accounting-stat:nth-child(2) {
        border-right: none;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-260px);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .content-header {
        padding: 16px 20px;
    }

    .header-left h1 {
        font-size: 18px;
    }

    .header-right {
        gap: 8px;
    }

    .tab-content-area {
        padding: 20px;
    }

    .accounting-stats {
        grid-template-columns: 1fr;
    }

    .accounting-stat {
        border-right: none;
    }
}

/* Global Filters */
.global-filters {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    display: flex;
    gap: 32px;
    align-items: flex-end;
    flex-wrap: wrap;
}

/* Make time period filter take full width on desktop */
.global-filters .filter-group:first-child {
    flex-basis: 100%;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-label-hint {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-gray);
    opacity: 0.7;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 4px;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Stats Sections */
.stats-section {
    margin-bottom: 32px;
}

.stats-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    padding-left: 4px;
}

.stats-grid-6 {
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.stats-grid-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

/* Compact stat cards for 4-column grid */
.stats-grid-4 .stat-card {
    padding: 16px;
    gap: 12px;
}

.stats-grid-4 .stat-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
}

.stats-grid-4 .stat-icon svg {
    width: 24px;
    height: 24px;
}

.stats-grid-4 .stat-value {
    font-size: 22px;
}

.stats-grid-4 .stat-label {
    font-size: 12px;
}

/* Compact stat cards for 6-column grid */
.stats-grid-6 .stat-card {
    padding: 16px;
    gap: 12px;
}

.stats-grid-6 .stat-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
}

.stats-grid-6 .stat-icon svg {
    width: 24px;
    height: 24px;
}

.stats-grid-6 .stat-value {
    font-size: 22px;
}

.stats-grid-6 .stat-label {
    font-size: 12px;
}

@media (max-width: 1400px) {
    .stats-grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1200px) {
    .stats-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid-6,
    .stats-grid-4 {
        grid-template-columns: 1fr;
    }

    .stats-grid-6 .stat-card,
    .stats-grid-4 .stat-card {
        padding: 20px;
        gap: 16px;
    }

    .stats-grid-6 .stat-icon,
    .stats-grid-4 .stat-icon {
        width: 56px;
        height: 56px;
    }

    .stats-grid-6 .stat-value,
    .stats-grid-4 .stat-value {
        font-size: 28px;
    }

    .global-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
    
    /* Reset time period filter width on mobile */
    .global-filters .filter-group:first-child {
        flex-basis: auto;
    }

    .filter-buttons {
        flex-wrap: wrap;
    }

    .filter-btn {
        flex: 1;
        min-width: 80px;
        text-align: center;
    }
}

/* Phone icon in stat card */
.stat-icon svg {
    color: var(--primary-color);
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Green highlighted stat cards */
.stat-card.stat-card-highlight {
    border-left: 4px solid #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.stat-card.stat-card-highlight:hover {
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
    transform: translateY(-4px);
}

.stat-card.stat-card-negative {
    border-left-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.stat-card.stat-card-negative:hover {
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.25);
}

.stat-card.stat-card-negative .stat-icon {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}

.stat-card.stat-card-negative .stat-value {
    color: #ef4444;
}

.stat-icon {
    font-size: 40px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Portal Section */
.portal-section {
    background: white;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
}

.portal-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* Return Criteria Markdown Styles */
#returnCriteriaContent {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
}

#returnCriteriaContent h1 {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

#returnCriteriaContent h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 16px 0;
}

#returnCriteriaContent h3 {
    font-size: 16px;
    font-weight: 600;
    color: #475569;
    margin: 16px 0 8px 0;
}

#returnCriteriaContent p {
    color: #475569;
    line-height: 1.6;
    margin: 0 0 12px 0;
}

#returnCriteriaContent ol {
    margin: 16px 0;
    padding-left: 24px;
    color: #334155;
    line-height: 2;
}

#returnCriteriaContent ul {
    margin: 8px 0 16px 0;
    padding-left: 24px;
    color: #475569;
    line-height: 1.8;
}

#returnCriteriaContent li {
    margin-bottom: 4px;
}

#returnCriteriaContent li ul {
    margin: 4px 0 8px 20px;
    list-style-type: disc;
}

#returnCriteriaContent li.nested {
    color: #64748b;
    font-size: 0.95em;
}

#returnCriteriaContent strong {
    font-weight: 600;
    color: #1e293b;
}

.section-description {
    color: var(--text-gray);
    margin-bottom: 24px;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.filter-controls {
    display: flex;
    gap: 12px;
}

.filter-select {
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Leads Table */
.cases-table-wrapper {
    overflow-x: auto;
}

.cases-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cases-table thead {
    background: var(--bg-light);
}

.cases-table th {
    text-align: left;
    padding: 16px;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

/* Sortable Table Headers */
.cases-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
    position: relative;
}

.cases-table th.sortable:hover {
    background: #e2e8f0;
}

.sort-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    vertical-align: middle;
    opacity: 0.4;
}

.sort-icon::after {
    content: '⇅';
    font-size: 12px;
}

th.sortable.asc .sort-icon::after {
    content: '↑';
    opacity: 1;
}

th.sortable.desc .sort-icon::after {
    content: '↓';
    opacity: 1;
}

th.sortable.asc .sort-icon,
th.sortable.desc .sort-icon {
    opacity: 1;
}

.cases-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-gray);
}

.cases-table tbody tr {
    transition: background-color 0.2s ease;
}

.cases-table tbody tr:hover {
    background: var(--bg-light);
}

.case-name {
    font-weight: 600;
    color: var(--text-dark);
}

.case-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.case-phone,
.case-email {
    font-size: 13px;
}

.case-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.case-status.new {
    background: #dbeafe;
    color: #1e40af;
}

.case-status.contacted {
    background: #fef3c7;
    color: #92400e;
}

.case-status.converted {
    background: #d1fae5;
    color: #065f46;
}

.case-status.closed {
    background: #f3f4f6;
    color: #6b7280;
}

/* New status badges */
.case-status.signed {
    background: #d1fae5;
    color: #065f46;
}

.case-status.replaced {
    background: #e0e7ff;
    color: #3730a3;
}

.case-status.verified {
    background: #dbeafe;
    color: #1e40af;
}

.case-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.case-status.canceled {
    background: #fee2e2;
    color: #991b1b;
}

.case-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-view {
    background: var(--primary-color);
    color: white;
}

.btn-view:hover {
    background: var(--primary-dark);
}

.btn-replace {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-replace:hover {
    background: #d1fae5;
    border-color: #10b981;
    color: #059669;
}

.btn-replace:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-replace:disabled:hover {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
}


/* Cancelation Reasons */
.cancelation-reasons-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cancelation-reason-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: 8px;
}

.reason-rank {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.reason-info {
    flex: 1;
}

.reason-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.reason-bar-container {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.reason-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.reason-percentage {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 50px;
    text-align: right;
}

/* Clickable Cancellation Reason Items */
.cancelation-reason-item.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.cancelation-reason-item.clickable:hover {
    background: #e0f2f1;
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.reason-drilldown-icon {
    color: var(--text-gray);
    opacity: 0.5;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.cancelation-reason-item.clickable:hover .reason-drilldown-icon {
    opacity: 1;
    color: var(--primary-color);
    transform: translateX(4px);
}

/* Supplier Ranking Styles */
.supplier-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.supplier-ranking-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: 8px;
}

.supplier-rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
    margin-right: 8px;
}

.supplier-rank.positive {
    background: #d1fae5;
    color: #047857;
}

.supplier-rank.negative {
    background: #fee2e2;
    color: #b91c1c;
}

.supplier-info {
    flex: 1;
    min-width: 0;
}

.supplier-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}

/* Media Portal - Publisher Name (same styling as supplier-name) */
.publisher-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
}

.supplier-bar-container {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.supplier-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.supplier-bar.positive {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.supplier-bar.negative {
    background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

.supplier-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.supplier-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.supplier-rate {
    font-size: 12px;
    font-weight: 500;
}

.supplier-rate.positive {
    color: #047857;
}

.supplier-rate.negative {
    color: #b91c1c;
}

/* Drill-down Modal */
.modal-wide {
    max-width: 1000px;
}

.drilldown-count {
    font-size: 14px;
    color: var(--text-gray);
    font-weight: 500;
    margin-top: 4px;
    display: block;
}

.drilldown-table .drilldown-notes {
    font-size: 13px;
    color: var(--text-gray);
    max-width: 200px;
    line-height: 1.4;
}

/* Request QA Button */
.btn-qa {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-qa:hover {
    background: #fde68a;
    border-color: #f59e0b;
}

.btn-qa.requested {
    background: #d1fae5;
    color: #059669;
    border-color: #10b981;
    cursor: default;
}

/* Sorted column indicators */
.sortable.sorted-asc .sort-icon,
.sortable.sorted-desc .sort-icon {
    color: var(--primary-color);
    font-weight: bold;
    margin-left: 4px;
}

.sortable:hover {
    background: rgba(16, 185, 129, 0.05);
    cursor: pointer;
}

/* Live Transfers Section */
.transfer-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.transfer-status.success {
    background: #d1fae5;
    color: #059669;
}

.transfer-status.no-answer {
    background: #fef3c7;
    color: #92400e;
}

.transfer-status.no-attempt {
    background: #fee2e2;
    color: #dc2626;
}

.transfer-agent {
    font-weight: 500;
    color: var(--text-dark);
}

.transfer-notes {
    font-size: 13px;
    color: var(--text-gray);
    max-width: 200px;
    line-height: 1.4;
}

/* Recording button */
.btn-recording {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-recording:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.btn-recording svg {
    margin-left: 2px;
}

/* Negative sentiment row highlighting */
.sentiment-negative-row {
    background: linear-gradient(90deg, #fef2f2 0%, #fee2e2 50%, #fef2f2 100%) !important;
}

.sentiment-negative-row:hover {
    background: linear-gradient(90deg, #fee2e2 0%, #fecaca 50%, #fee2e2 100%) !important;
}

.sentiment-negative-row td {
    border-bottom-color: #fecaca;
}

/* Sentiment Selector */
.sentiment-selector {
    display: flex;
    gap: 8px;
}

.sentiment-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    background: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sentiment-btn:hover {
    transform: scale(1.15);
}

.sentiment-btn.positive {
    border-color: #10b981;
}

.sentiment-btn.positive:hover,
.sentiment-btn.positive.selected {
    background: #d1fae5;
    border-color: #059669;
}

.sentiment-btn.neutral {
    border-color: #f59e0b;
}

.sentiment-btn.neutral:hover,
.sentiment-btn.neutral.selected {
    background: #fef3c7;
    border-color: #d97706;
}

.sentiment-btn.negative {
    border-color: #ef4444;
}

.sentiment-btn.negative:hover,
.sentiment-btn.negative.selected {
    background: #fee2e2;
    border-color: #dc2626;
}

.sentiment-btn.selected {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Replacements List */
.replacements-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px; /* Space before pagination */
}

.replacement-item {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.replacement-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.replacement-case-name {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.replacement-date {
    font-size: 13px;
    color: var(--text-gray);
}

.replacement-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.replacement-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.replacement-status.approved {
    background: #d1fae5;
    color: #065f46;
}

.replacement-status.denied {
    background: #fee2e2;
    color: #991b1b;
}

.replacement-reason {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.replacement-notes {
    font-size: 13px;
    color: var(--text-light);
    font-style: italic;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-gray);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Case details modal should appear above campaign modal when both are open */
#caseModal {
    z-index: 2100;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

/* Override max-width for extra-wide modals */
.modal-content.modal-extra-wide {
    max-width: 1600px !important;
    width: 98% !important;
}

/* Small modal for informational alerts */
.modal-content.modal-small {
    max-width: 450px !important;
    width: 90% !important;
}

.alert-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.alert-message {
    text-align: center;
    font-size: 15px;
    line-height: 1.6;
    color: #374151;
    margin: 0;
}

.modal-small .modal-header {
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.modal-small .modal-header h2 {
    margin: 0;
    color: #10b981;
}

.modal-small .modal-footer {
    display: flex;
    justify-content: center;
    padding: 20px;
    border-top: none;
}

.modal-small .modal-footer .btn-primary {
    min-width: 120px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-gray);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: var(--bg-light);
}

.modal-body {
    padding: 32px;
}

.modal-footer {
    padding: 24px 32px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Small Modal (for date picker) */
.modal-small {
    max-width: 400px;
}

/* Date Range Form */
.date-range-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.date-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-dark);
    background: white;
    transition: all 0.2s ease;
}

.date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    background-color: #f3f4f6;
    transition: background-color 0.2s ease;
}

.date-input::-webkit-calendar-picker-indicator:hover {
    background-color: #e5e7eb;
}

/* Custom filter button with date display */
.filter-btn.has-dates {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn .date-display {
    font-size: 12px;
    opacity: 0.9;
}

.case-detail-row {
    margin-bottom: 20px;
}

.case-detail-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.case-detail-value {
    font-size: 16px;
    color: var(--text-dark);
    font-weight: 500;
}

/* Case Notes Textarea (scrollable) */
.case-notes-textarea {
    width: 100%;
    min-height: 120px;
    max-height: 300px;
    padding: 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-dark);
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    resize: vertical;
    overflow-y: auto;
    line-height: 1.6;
}

.case-notes-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
}

/* Responsive */
@media (max-width: 768px) {
    .portal-header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .section-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-controls {
        width: 100%;
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
    }

    .cases-table {
        font-size: 12px;
    }

    .cases-table th,
    .cases-table td {
        padding: 12px 8px;
    }

    .login-card {
        padding: 32px 24px;
    }

    .modal-content {
        width: 95%;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
    
    /* Milestone filters mobile styles */
    .milestone-filters {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    
    .milestone-btn {
        width: 100%;
        min-width: unset;
        flex-direction: row;
        justify-content: space-between;
        padding: 12px 16px;
    }
    
    .milestone-btn > * {
        flex-shrink: 0;
    }
    
    .milestone-number {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .milestone-label {
        flex: 1;
        text-align: left;
        margin-left: 12px;
        font-size: 14px;
    }
    
    .milestone-count {
        font-size: 16px;
    }
    
    .milestone-connector {
        display: none;
    }
}

/* Collapsible Sections */
.collapsible-section .section-toggle {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: color 0.2s ease;
}

.collapsible-section .section-toggle:hover {
    color: var(--primary-color);
}

.toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    color: var(--text-gray);
}

.collapsible-section.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.collapsible-section .section-content {
    overflow: hidden;
    max-height: 100000px; /* Large enough to accommodate expanded content */
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    opacity: 1;
}

.collapsible-section.collapsed .section-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Adjust section header row in Your Cases to work with toggle */
.section-header-row .section-toggle {
    margin-bottom: 0;
}

.section-header-row {
    margin-bottom: 24px;
}

.collapsible-section.collapsed .section-header-row {
    margin-bottom: 0;
}

/* Stats section title toggle alignment */
.stats-section-title.section-toggle {
    margin-bottom: 16px;
}

.collapsible-section.collapsed .stats-section-title.section-toggle {
    margin-bottom: 0;
}

/* Case Tracker Milestones */
.milestone-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: 12px;
    gap: 8px;
    flex-wrap: wrap;
}

.milestone-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    position: relative;
}

.milestone-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.milestone-btn.active {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.milestone-number {
    width: 28px;
    height: 28px;
    background: var(--border-color);
    color: var(--text-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.milestone-btn.active .milestone-number {
    background: var(--primary-color);
    color: white;
}

.milestone-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-gray);
    text-align: center;
    transition: color 0.2s ease;
}

.milestone-btn.active .milestone-label {
    color: var(--text-dark);
}

.milestone-count {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
}

.milestone-btn.active .milestone-count {
    color: var(--primary-color);
}

.milestone-connector {
    width: 24px;
    height: 2px;
    background: var(--border-color);
    flex-shrink: 0;
}

/* Days in stage badge */
.days-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.days-badge.low {
    background: #d1fae5;
    color: #065f46;
}

.days-badge.medium {
    background: #fef3c7;
    color: #92400e;
}

.days-badge.high {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 1024px) {
    .milestone-filters {
        justify-content: center;
    }

    .milestone-connector {
        display: none;
    }

    .milestone-btn {
        flex: 1;
        min-width: 100px;
    }
}

@media (max-width: 600px) {
    .milestone-btn {
        min-width: 80px;
        padding: 12px 10px;
    }

    .milestone-label {
        font-size: 11px;
    }
}

/* Case Tracker Bar Chart */
.tracker-chart-section {
    margin-bottom: 24px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tracker-bar-chart {
    display: flex;
    align-items: stretch;
    padding: 20px;
    padding-bottom: 0;
    width: 100%;
    min-width: min-content;
    box-sizing: border-box;
}

.chart-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-right: 12px;
    padding-bottom: 40px;
    min-width: 30px;
    text-align: right;
    flex-shrink: 0;
}

.chart-y-axis span {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    line-height: 1;
}

.chart-main {
    flex: 1;
    position: relative;
    min-height: 220px;
    min-width: 400px;
    overflow: visible;
}

.chart-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.chart-grid .grid-line {
    height: 1px;
    background: #e2e8f0;
    width: 100%;
}

.chart-bars {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    gap: 8px;
}

.bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 auto;
    max-width: 100px;
    min-width: 0;
    cursor: pointer;
    padding-bottom: 40px;
}

.bar-track {
    width: 50px;
    height: 180px;
    background: #e2e8f0;
    border-radius: 6px 6px 0 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    width: 100%;
    background: linear-gradient(to top, #047857, #10b981);
    border-radius: 6px 6px 0 0;
    transition: height 0.6s ease-out;
    height: 0;
}

.bar-wrapper.active .bar-fill,
.bar-fill[data-active="true"] {
    background: linear-gradient(to top, #065f46, #059669);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

.bar-wrapper:hover .bar-track {
    background: #cbd5e1;
}

.bar-value {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.bar-label {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    text-align: center;
    white-space: nowrap;
}

@media (max-width: 768px) {
    /* Allow horizontal scrolling for bar charts on mobile */
    .portal-section {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Make table-based charts scrollable */
    .portal-section > table {
        min-width: 500px;
    }
    
    .tracker-chart-section {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Ensure parent containers allow scrolling */
    .portal-section:has(.tracker-chart-section),
    .portal-card:has(.tracker-chart-section) {
        overflow-x: visible;
    }
    
    .tracker-bar-chart {
        padding: 12px;
        padding-bottom: 0;
        min-width: 400px;
    }

    .chart-y-axis {
        min-width: 24px;
        padding-right: 6px;
    }

    .chart-y-axis span {
        font-size: 10px;
    }

    .chart-main {
        min-height: 180px;
        min-width: 350px;
    }
    
    .chart-bars {
        padding: 0 8px;
    }

    .bar-track {
        width: 40px;
        height: 140px;
    }

    .bar-value {
        font-size: 12px;
    }

    .bar-label {
        font-size: 10px;
    }

    .bar-wrapper {
        padding-bottom: 36px;
        max-width: 80px;
        min-width: 50px;
    }

    .chart-grid {
        bottom: 36px;
    }
}

@media (max-width: 480px) {
    .tracker-bar-chart {
        padding: 8px;
        padding-bottom: 0;
        min-width: 350px;
    }
    
    .chart-y-axis {
        min-width: 20px;
        padding-right: 4px;
    }
    
    .chart-main {
        min-width: 300px;
    }
    
    .chart-bars {
        padding: 0 4px;
    }
    
    .bar-track {
        width: 36px;
        height: 120px;
    }

    .bar-label {
        font-size: 9px;
    }
    
    .bar-value {
        font-size: 11px;
    }
    
    .bar-wrapper {
        max-width: 70px;
        min-width: 45px;
        padding-bottom: 32px;
    }
}

/* Line Graph Styles */
.line-graph-container {
    display: flex;
    padding: 20px;
    padding-bottom: 0;
}

.line-graph-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-right: 12px;
    padding-bottom: 30px;
    min-width: 30px;
    text-align: right;
}

.line-graph-y-axis span {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.line-graph-main {
    flex: 1;
    position: relative;
    height: 200px;
}

.line-graph-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.line-grid-row {
    border-bottom: 1px dashed #e2e8f0;
    width: 100%;
}

.line-graph-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 30px);
}

.line-graph-line {
    stroke-linecap: round;
    stroke-linejoin: round;
}

.line-graph-points circle {
    fill: #10b981;
    stroke: white;
    stroke-width: 2;
    cursor: pointer;
    transition: r 0.2s ease;
}

.line-graph-points circle:hover {
    r: 7;
}

.line-graph-tooltip {
    position: absolute;
    background: #1e293b;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 100;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translate(-50%, -100%);
    margin-top: -10px;
}

.line-graph-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

.line-graph-tooltip.visible {
    opacity: 1;
}

.line-graph-x-axis {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.line-graph-x-axis span {
    font-size: 10px;
    color: #64748b;
    text-align: center;
}

@media (max-width: 768px) {
    .line-graph-container {
        padding: 16px;
        padding-bottom: 0;
    }

    .line-graph-main {
        height: 160px;
    }

    .line-graph-y-axis span {
        font-size: 10px;
    }

    .line-graph-x-axis span {
        font-size: 8px;
    }
}

/* Pagination Styles */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    padding: 16px;
}

.pagination-btn {
    padding: 8px 16px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: #ecfdf5;
    color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 14px;
    color: var(--text-gray);
    font-weight: 600;
    min-width: 120px;
    text-align: center;
}

/* Replacement Status Badges */
.replacement-status {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.replacement-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.replacement-status.approved {
    background: #d1fae5;
    color: #065f46;
}

.replacement-status.rejected {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
    }

    .pagination-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .pagination-info {
        width: 100%;
        order: -1;
        margin-bottom: 8px;
    }
}

/* Return Summary Card Styles (matching media portal) */
.return-summary-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
    padding: 16px 0;
}

.return-summary-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.return-summary-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.return-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    user-select: none;
}

.return-summary-header:hover {
    background: #f1f5f9;
}

.return-summary-content {
    display: block;
    max-height: 1000px;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.return-summary-item.collapsed .return-summary-content {
    max-height: 0;
    opacity: 0;
    padding: 0;
}

.return-summary-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    padding: 16px 20px;
    background: #fafbfc;
}

.return-summary-notes {
    padding: 12px 16px;
    display: flex;
    flex-direction: row;
    gap: 24px;
    border-top: 1px solid #e2e8f0;
}

.return-summary-footer {
    display: flex;
    gap: 16px;
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #64748b;
}

.collapse-icon {
    transition: transform 0.3s ease;
}

.return-summary-item.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

/* Replacements List Styles */
.replacements-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.replacement-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.replacement-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}
