/* Styles extracted from templates/index.html */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    width: 100%;
    overflow-x: hidden;
}

.e-loadholder {
    position: relative;
    width: 240px;
    height: 240px;
    border: 5px solid rgba(255,255,255,0.35);
    border-radius: 120px;
    box-sizing: border-box;
    margin: 0 auto 12px;
}

.e-loadholder:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 200%;
    background: #222;
    transform: translate(-50%, -50%);
    transform-origin: center;
    z-index: 0;
    animation: outerRotate2 30s infinite linear;
}

.m-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    color: #888;
    text-align: center;
    border: 5px solid rgba(255,255,255,0.25);
    border-radius: 100px;
    box-sizing: border-box;
    z-index: 20;
    text-transform: uppercase;
}

.m-loader:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 106%;
    background: #222;
    transform: translate(-50%, -50%);
    transform-origin: center;
    z-index: -1;
    animation: outerRotate1 15s infinite linear;
}

.m-loader .e-text {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140px;
    height: 140px;
    transform: translate(-51%, -50%);
    animation: textColour 1s alternate linear infinite;
    display: block;
    text-align: center;
    border: 5px solid rgba(255,255,255,0.25);
    border-radius: 70px;
    box-sizing: border-box;
    z-index: 20;
    padding-top: 55px;
    font-size: 14px;
    line-height: 1.4;
    background: transparent;
}

.m-loader .e-text:before,
.m-loader .e-text:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: #222;
    transform: translate(-50%, -50%);
    transform-origin: center;
    z-index: -1;
}

.m-loader .e-text:before {
    width: 110%;
    height: 40px;
    animation: outerRotate2 3.5s infinite linear;
}

.m-loader .e-text:after {
    width: 40px;
    height: 110%;
    animation: outerRotate1 8s infinite linear;
}

@keyframes outerRotate1 {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes outerRotate2 {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(-360deg); }
}

@keyframes textColour {
    0% { color: #fff; }
    100% { color: #3BB2D0; }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(3px);
    overflow: hidden;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
    color: #4b5563;
    min-width: 320px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    gap: 18px;
}

.spinner-stack {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 6px solid rgba(255, 255, 255, 0.08);
}

.spinner-ring-1 {
    border-top-color: #a5b4fc;
    animation: spin 1.1s linear infinite;
}

.spinner-ring-2 {
    inset: 12px;
    border: 6px solid rgba(255,255,255,0.12);
    border-right-color: #60a5fa;
    animation: spinReverse 1.6s linear infinite;
}

.spinner-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulseDot 1s ease-in-out infinite;
}

.loading-label {
    color: #e5e7eb;
    font-weight: 700;
    letter-spacing: 0.02em;
}

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

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

@keyframes pulseDot {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.4); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

/* Enhanced navbar with modern gradient and shadows */
.navbar {
    background: linear-gradient(135deg, #3b82f6 0%, #0ea5e9 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 1.1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: white !important;
}

.navbar-text {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 500;
}



/* Enhanced filter container with top accent border */
.filter-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-top: 4px solid #667eea;
}

.filter-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.7rem;
    display: block;
    font-size: 14px;
}

.form-select {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Enhanced section titles with icons */
.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #333;
    margin: 2.5rem 0 1.8rem 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #667eea;
    display: inline-block;
}

.section-title i {
    color: #667eea;
}

/* Improved metric cards with gradient backgrounds and animations */
.metric-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-top: 4px solid #667eea;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

.metric-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
}

.metric-card.success {
    border-top-color: #10b981;
}

.metric-card.danger {
    border-top-color: #ef4444;
}

.metric-card.warning {
    border-top-color: #f59e0b;
}

.metric-card.info {
    border-top-color: #667eea;
}

.metric-value {
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.metric-card.success .metric-value {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-card.danger .metric-value {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-card.warning .metric-value {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-label {
    color: #666;
    font-size: 0.95rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* Enhanced gauge container with rounded corners */
.gauge-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-top: 4px solid #667eea;
    text-align: center;
}

.gauge-title {
    font-weight: 700;
    color: #333;
    margin-top: 1.5rem;
    font-size: 1.1rem;
}

/* Enhanced status cards with hover effects */
.status-card {
    background: white;
    border-radius: 12px;
    padding: 1.8rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    border-left: 4px solid #667eea;
}

.status-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
}

.status-word {
    font-weight: 600;
    color: #667eea;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    word-wrap: break-word;
    text-transform: capitalize;
}

.status-count {
    color: #333;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Improved table container with rounded corners */
.table-container {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.table thead th {
    color: white;
    font-weight: 700;
    border: none;
    padding: 1.3rem;
    text-align: left;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: none;
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:hover {
    background-color: inherit;
}

.table tbody td {
    padding: 1.1rem 1.3rem;
    vertical-align: middle;
    color: #555;
}

/* Enhanced pagination with gradient styling */
.pagination {
    margin-top: 2rem;
}

.page-link {
    border: 2px solid #e5e7eb;
    color: #667eea;
    border-radius: 8px;
    margin: 0 0.3rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.page-link:hover {
    color: white;
    border-color: #667eea;
    background: #667eea;
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

@media (max-width: 768px) {
    .metric-card {
        margin-bottom: 1rem;
    }

    .status-card {
        margin-bottom: 1rem;
    }

    .table-responsive {
        font-size: 0.85rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.75rem;
    }

    .dashboard-title {
        font-size: 1.6rem;
    }
}

/* Styles extracted from templates/dashboard.html */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    width: 100%;
    overflow-x: hidden;
}

/* Enhanced navbar with modern gradient and improved spacing */
.navbar-custom {
    background: linear-gradient(135deg, #0ea5e9 0%, #0b7a75 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 18px 0;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-custom .navbar-brand {
    font-weight: 700;
    font-size: 20px;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Improved main content padding and spacing */
.main-content {
    padding: 35px 20px;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
}

.page-header {
    margin-bottom: 35px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #0ea5e9 0%, #0b7a75 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.page-subtitle {
    color: #666;
    font-size: 15px;
    font-weight: 500;
}

/* Enhanced filter section with new styling */
.filter-section {
    background: white;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    border-top: 3px solid #667eea;
}

.filter-section form {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    align-items: flex-end;
    justify-content: center;
}

.filter-section .col-md-5 {
    flex: 1;
    min-width: 250px;
}

.filter-section .filter-label {
    font-weight: bold;
    color: black;
    margin-bottom: 12px;
    font-size: 16px;
    display: block;
}

/* Enhanced dropdown styling with better interactivity */
.filter-section .form-select {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23667eea' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.filter-section .form-select:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.filter-section .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    outline: none;
}

/* Enhanced metric cards with modern styling and animations */
.metric-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    border-top: 4px solid #667eea;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
}

.metric-value {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.metric-label {
    color: #666;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.metric-card.success {
    border-top-color: #10b981;
}

.metric-card.success .metric-value {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-card.danger {
    border-top-color: #ef4444;
}

.metric-card.danger .metric-value {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-card.warning {
    border-top-color: #f59e0b;
}

.metric-card.warning .metric-value {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
    display: inline-block;
    position: relative;
}

/* Replace entire gauge container styling for semicircular design */
.gauge-container {
    background: white;
    border-radius: 12px;
    padding: 30px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    border-top: 4px solid #667eea;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 320px;
    width: 100%;
    position: relative;
}

.gauge-container canvas {
    max-width: 220px !important;
    max-height: 140px !important;
    height: 140px !important;
    width: 220px !important;
    margin: 10px auto 20px auto;
    display: block;
}

.gauge-label {
    color: #666;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 15px;
    display: block;
}

.gauge-value-display {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    margin-top: 10px;
}

/* Enhanced status cards with new colors and hover effects */
.status-card {
    background: white;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    border-left: 4px solid #667eea;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
}

.status-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
}

.status-label {
    color: #666;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: block;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-count {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Interactive Table Styling */
.table-container {
    background: white;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    border-top: 4px solid #667eea;
    margin-bottom: 30px;
    width: 100%;
    overflow: visible;
    max-width: 100%;
}

.search-input-wrapper {
    position: relative;
    min-width: 280px;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.search-input-wrapper::before {
    content: '\00a0';
    height: 20px;
    line-height: 20px;
    display: block;
}

.search-input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 16px;
}

.table-search-input {
    width: 100%;
    padding: 12px 16px 12px 45px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.table-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.table-responsive {
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 8px;
    width: 100%;
}

.table-scrollable {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    width: 100%;
}

.calls-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: auto;
    min-width: 1400px;
}

.calls-table thead {
    background: linear-gradient(135deg, #0ea5e9 0%, #0b7a75 100%);
    color: white;
}

.calls-table thead th {
    padding: 14px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: relative;
    white-space: nowrap;
}

.calls-table thead th.sortable {
    cursor: pointer;
    user-select: none;
    transition: none;
}

.calls-table thead th .sort-icon {
    margin-left: 8px;
    font-size: 12px;
    opacity: 0.7;
}

.calls-table thead th.sort-asc .sort-icon::before {
    content: "\f128";
    font-family: "bootstrap-icons";
    opacity: 1;
}

.calls-table thead th.sort-desc .sort-icon::before {
    content: "\f12a";
    font-family: "bootstrap-icons";
    opacity: 1;
}

.calls-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: none;
}

.calls-table tbody tr:hover {
    background: inherit;
    transform: none;
}

.calls-table tbody td {
    padding: 12px 10px;
    color: #333;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
    font-size: 12px;
}

.calls-table thead th,
.calls-table tbody td {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.calls-table thead th:nth-child(2),
.calls-table tbody td:nth-child(2) {
    white-space: nowrap;
    min-width: 180px;
    overflow-wrap: normal;
    word-break: normal;
}

.calls-table thead th:nth-child(3),
.calls-table tbody td:nth-child(3) {
    white-space: nowrap;
    min-width: 220px;
    overflow-wrap: normal;
    word-break: normal;
}

.calls-table thead th:nth-child(4),
.calls-table tbody td:nth-child(4) {
    white-space: nowrap;
    min-width: 160px;
    overflow-wrap: normal;
    word-break: normal;
}

.calls-table thead th:nth-child(7),
.calls-table tbody td:nth-child(7),
.calls-table thead th:nth-child(8),
.calls-table tbody td:nth-child(8) {
    white-space: nowrap;
    min-width: 190px;
    overflow-wrap: normal;
    word-break: normal;
}

.calls-table thead th:nth-child(14),
.calls-table tbody td:nth-child(14) {
    white-space: nowrap;
    min-width: 150px;
    overflow-wrap: normal;
    word-break: normal;
}

.calls-table tbody td .badge-project,
.calls-table tbody td .status-badge,
.calls-table tbody td .call-status-badge,
.calls-table tbody td .duration-badge {
    white-space: nowrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    display: inline-block;
}

.badge-project {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

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

/* Unique colors for each call connection status */
.status-badge.status-assistant-ended-call {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-badge.status-call-in-progress-twilio-completed-call {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.status-badge.status-voicemail {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.status-badge.status-customer-did-not-answer {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.status-badge.status-customer-busy {
    background: rgba(251, 191, 36, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.status-badge.status-customer-ended-call {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.status-badge.status-pipeline-error-eleven-labs-quota-exceeded {
    background: rgba(220, 38, 38, 0.15);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.4);
}

.status-badge.status-pipeline-error-eleven-labs-voice-failed {
    background: rgba(185, 28, 28, 0.15);
    color: #991b1b;
    border: 1px solid rgba(185, 28, 28, 0.4);
}

.status-badge.status-twilio-failed-to-connect-call {
    background: rgba(153, 27, 27, 0.15);
    color: #7f1d1d;
    border: 1px solid rgba(153, 27, 27, 0.4);
}

.status-badge.status-silence-timed-out {
    background: rgba(127, 29, 29, 0.15);
    color: #7f1d1d;
    border: 1px solid rgba(127, 29, 29, 0.4);
}

.status-badge.status-call-not-placed {
    background: rgba(107, 114, 128, 0.15);
    color: #4b5563;
    border: 1px solid rgba(107, 114, 128, 0.4);
}

.call-id {
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    color: #667eea;
}

.duration-badge {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: #059669;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.2);
    white-space: nowrap;
}

.recording-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #1e90ff 0%, #0066ff 50%, #0047ab 100%);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s ease;
}

.recording-link:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
}

.table-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.table-info {
    color: #666;
    font-size: 13px;
}

.table-info strong {
    color: #667eea;
    font-weight: 700;
}

.pagination-controls {
    display: flex;
    align-items: center;
}

.pagination {
    margin: 0;
}

.pagination .page-link {
    color: #667eea;
    border-color: #e5e7eb;
    padding: 8px 12px;
    transition: all 0.2s ease;
}

.pagination .page-link:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: #667eea;
    color: #667eea;
}

.pagination .page-item.active .page-link {
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    background: linear-gradient(135deg, #1e90ff 0%, #0066ff 50%, #0047ab 100%);    
    border-color: #667eea;
    color: white;
}

.pagination .page-item.disabled .page-link {
    color: #9ca3af;
    background: #f3f4f6;
    border-color: #e5e7eb;
    cursor: not-allowed;
}

/* Inline filter styling */
.filter-inline {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-inline .filter-label {
    font-weight: 600;
    color: #333;
    font-size: 12px;
    display: block;
    margin-bottom: 0;
}

.filter-inline .form-select {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    background: white;
    transition: all 0.3s ease;
    font-weight: 500;
    cursor: pointer;
}

.filter-inline .form-select:hover {
    border-color: #667eea;
}

.filter-inline .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    outline: none;
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px 15px;
    }

    .page-title {
        font-size: 24px;
    }

    .metric-card {
        padding: 18px;
    }

    .metric-value {
        font-size: 28px;
    }

    .gauge-container {
        min-height: 320px;
    }

    .gauge-container canvas {
        max-width: 150px !important;
        max-height: 100px !important;
        height: 100px !important;
        width: 150px !important;
    }

    .filter-section form {
        flex-direction: column;
        gap: 15px;
    }

    .filter-section .col-md-5 {
        width: 100%;
    }

    .table-container {
        padding: 18px;
    }

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

    .calls-table thead th {
        padding: 12px 8px;
        font-size: 11px;
    }

    .calls-table tbody td {
        padding: 10px 8px;
    }

    .search-input-wrapper {
        max-width: 100%;
        min-width: 100%;
    }

    .table-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .pagination-controls {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    .filter-inline {
        width: 100%;
    }
    
    .filter-inline .form-select {
        width: 100% !important;
    }
}







/* ================================
   Unified Filter Alignment
================================ */
.filter-inline,
.search-input-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}

/* Match label spacing */
.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Mobile-first filter alignment tweaks */
@media (max-width: 768px) {
    #filterForm {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    #filterForm > div {
        width: 100%;
    }
    .filter-inline,
    .search-input-wrapper {
        width: 100% !important;
    }
    .filter-inline .form-select,
    .search-input-wrapper input {
        width: 100% !important;
    }
    .main-content .d-flex.align-items-end.flex-wrap.gap-3 {
        gap: 12px !important;
    }
}

/* Normalize heights of select + input */
.form-select-sm,
.table-search-input {
  height: 38px;                 /* Bootstrap sm select height */
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 6px;
}

/* Search wrapper consistency */
.search-input-wrapper {
  min-width: 180px;
}

/* Optional: cleaner input look */
.table-search-input {
  border: 1px solid #d1d5db;
}

.table-search-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25);
}

/* Text truncation and expansion styles */
.text-cell {
    max-width: 300px;
    min-width: 200px;
    width: 250px;
}

.truncated-text {
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
}

.btn-expand {
    background: linear-gradient(135deg, #1e90ff 0%, #0066ff 50%, #0047ab 100%);
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    transition: all 0.2s ease;
    min-width: 90px;
    max-width: 120px;
    display: inline-block;
    text-align: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-expand:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-expand:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.2);
}

.feedback-cell {
    min-width: 150px;
}

.feedback-select {
    min-width: 150px;
}

.status-select-success {
    border-color: #2e7d32 !important;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.18);
    background-color: #e8f5e9 !important;
    color: #1b5e20 !important;
    font-weight: 600;
}

.status-select-unsuccessful {
    border-color: #c62828 !important;
    box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.18);
    background-color: #ffebee !important;
    color: #b71c1c !important;
    font-weight: 600;
}

.tester-color-0 {
    border-color: #1e88e5 !important;
    box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.2);
    background-color: #e3f2fd !important;
    color: #0a2f6f !important;
    font-weight: 600;
}

.tester-color-1 {
    border-color: #8e24aa !important;
    box-shadow: 0 0 0 2px rgba(142, 36, 170, 0.2);
    background-color: #f3e5f5 !important;
    color: #2f0c59 !important;
    font-weight: 600;
}

.tester-color-2 {
    border-color: #009688 !important;
    box-shadow: 0 0 0 2px rgba(0, 150, 136, 0.2);
    background-color: #e0f2f1 !important;
    color: #05312c !important;
    font-weight: 600;
}

.tester-color-3 {
    border-color: #fb8c00 !important;
    box-shadow: 0 0 0 2px rgba(251, 140, 0, 0.2);
    background-color: #fff3e0 !important;
    color: #9c3a00 !important;
    font-weight: 600;
}

.tester-color-4 {
    border-color: #5e35b1 !important;
    box-shadow: 0 0 0 2px rgba(94, 53, 177, 0.2);
    background-color: #ede7f6 !important;
    color: #221160 !important;
    font-weight: 600;
}

.tester-color-5 {
    border-color: #26a69a !important;
    box-shadow: 0 0 0 2px rgba(38, 166, 154, 0.2);
    background-color: #e0f7fa !important;
    color: #0a3e38 !important;
    font-weight: 600;
}

.tester-color-6 {
    border-color: #7cb342 !important;
    box-shadow: 0 0 0 2px rgba(124, 179, 66, 0.22);
    background-color: #f1f8e9 !important;
    color: #244913 !important;
    font-weight: 600;
}

.tester-color-7 {
    border-color: #d81b60 !important;
    box-shadow: 0 0 0 2px rgba(216, 27, 96, 0.22);
    background-color: #fce4ec !important;
    color: #600a37 !important;
    font-weight: 600;
}

.ai-errors-cell,
.feedback-text-cell {
    min-width: 260px;
}

.ai-errors-actions,
.feedback-text-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.ai-errors-edit,
.feedback-text-edit {
    margin-top: 8px;
}

.ai-errors-edit textarea,
.feedback-text-edit textarea {
    resize: vertical;
}

.icon-button {
    background: transparent;
    border: none;
    padding: 4px 6px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.icon-button i {
    font-size: 16px;
}

.icon-button:hover {
    background: rgba(102, 126, 234, 0.12);
    transform: translateY(-1px);
}

.icon-button.text-danger:hover {
    background: rgba(248, 113, 113, 0.15);
}

.call-status-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

/* Modal styles */
.modal-body {
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 70vh;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

/* Responsive modal for mobile */
@media (max-width: 768px) {
    .modal-body {
        padding: 15px;
        font-size: 12px;
        max-height: 60vh;
    }
    
    .modal-dialog {
        margin: 10px;
    }
}

@media (max-width: 576px) {
    .modal-body {
        padding: 12px;
        font-size: 11px;
        max-height: 50vh;
    }
    
    .modal-dialog {
        margin: 5px;
    }
    
    .modal-header {
        padding: 10px 12px;
    }
    
    .modal-footer {
        padding: 10px 12px;
    }
}

/* Large screens - optimize table width */
@media (min-width: 1400px) {
    .main-content {
        padding: 35px 40px;
    }
    
    .table-container {
        padding: 30px;
    }
    
    .calls-table {
        font-size: 13px;
    }
    
    .calls-table thead th {
        padding: 16px 12px;
    }
    
    .calls-table tbody td {
        padding: 14px 12px;
    }
    
    .text-cell {
        max-width: 350px;
        min-width: 250px;
        width: 300px;
    }
}

/* Enhanced responsive design */
@media (max-width: 1200px) {
    .calls-table {
        font-size: 12px;
        table-layout: auto;
        min-width: 1100px;
    }
    
    .calls-table thead th {
        padding: 12px 8px;
        font-size: 10px;
        white-space: nowrap;
    }
    
    .calls-table tbody td {
        padding: 10px 8px;
        font-size: 11px;
    }
    
    .text-cell {
        max-width: 200px;
        min-width: 150px;
        width: 180px;
    }
}

@media (max-width: 992px) {
    .main-content {
        padding: 20px 15px;
    }
    
    .table-container {
        padding: 15px;
        overflow-x: auto;
    }
    
    .table-scrollable {
        overflow-x: auto;
    }
    
    .calls-table {
        font-size: 11px;
        table-layout: auto;
        min-width: 850px;
    }
    
    .text-cell {
        max-width: 170px;
        min-width: 130px;
        width: auto;
    }
    
    .badge-project,
    .status-badge,
    .duration-badge,
    .call-status-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 15px 10px;
    }

    .page-title {
        font-size: 20px;
    }

    .metric-card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .metric-value {
        font-size: 24px;
    }

    .gauge-container {
        min-height: 280px;
        padding: 20px 15px;
    }

    .gauge-container canvas {
        max-width: 120px !important;
        max-height: 80px !important;
        height: 80px !important;
        width: 120px !important;
    }

    .filter-section form {
        flex-direction: column;
        gap: 12px;
    }

    .filter-section .col-md-5 {
        width: 100%;
    }

    .table-container {
        padding: 12px;
        overflow-x: auto;
    }

    .table-scrollable {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .calls-table {
        font-size: 10px;
        min-width: 950px;
    }

    .calls-table thead th {
        padding: 10px 3px;
        font-size: 9px;
        white-space: nowrap;
    }

    .calls-table tbody td {
        padding: 8px 3px;
        font-size: 10px;
    }

    .text-cell {
        max-width: 130px;
        min-width: 90px;
    }

    .search-input-wrapper {
        max-width: 100%;
        min-width: 100%;
    }

    .table-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .pagination-controls {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
        overflow-x: auto;
    }
    
    .filter-inline {
        width: 100%;
    }
    
    .filter-inline .form-select {
        width: 100% !important;
    }
    
    .section-title {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .status-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .status-label {
        font-size: 11px;
        min-height: 32px;
    }
    
    .status-count {
        font-size: 24px;
    }
    
    .badge-project,
    .status-badge,
    .duration-badge,
    .call-status-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
    
    .btn-expand {
        font-size: 9px;
        padding: 4px 8px;
        min-width: 80px;
        max-width: 100px;
        width: auto;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 10px 8px;
    }
    
    .navbar-custom .navbar-brand {
        font-size: 16px;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    .metric-card {
        padding: 12px;
    }
    
    .metric-value {
        font-size: 20px;
    }
    
    .calls-table {
        min-width: 850px;
        font-size: 9px;
    }
    
    .calls-table thead th {
        padding: 8px 2px;
        font-size: 8px;
    }
    
    .calls-table tbody td {
        padding: 6px 2px;
        font-size: 9px;
    }
    
    .text-cell {
        max-width: 90px;
        min-width: 70px;
    }
    
    .btn-expand {
        font-size: 8px;
        padding: 3px 6px;
        min-width: 70px;
        max-width: 90px;
        width: auto;
    }
    
    .feedback-text-edit .btn {
        font-size: 8px;
        padding: 4px 8px;
        white-space: nowrap;
    }
    
    .feedback-text-edit textarea {
        font-size: 9px;
        padding: 6px;
    }
}

/* -------------------------------------------------
   Responsive refinements (mobile/tablet friendly)
-------------------------------------------------- */
.table-scrollable {
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}

/* Base tightening for very wide tables */
.calls-table {
    min-width: 1300px;
}

@media (max-width: 1200px) {
    .calls-table {
        min-width: 1100px;
    }
}

@media (max-width: 992px) {
    .main-content {
        padding: 18px 12px;
    }
    .table-container {
        padding: 18px;
        overflow-x: auto;
    }
    .calls-table {
        min-width: 900px;
        font-size: 11px;
    }
    .text-cell,
    .ai-errors-cell,
    .feedback-text-cell,
    .feedback-cell {
        min-width: 120px;
        max-width: 160px;
        width: auto;
    }
    .search-input-wrapper,
    .filter-inline {
        width: 100%;
    }
    .search-input-wrapper input,
    .filter-inline .form-select {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .calls-table {
        min-width: 760px;
        font-size: 10px;
    }
    .calls-table thead th {
        font-size: 9px;
        padding: 10px 6px;
    }
    .calls-table tbody td {
        font-size: 10px;
        padding: 8px 6px;
    }
    .text-cell,
    .ai-errors-cell,
    .feedback-text-cell,
    .feedback-cell {
        min-width: 90px;
        max-width: 130px;
    }
    /* Hide lower-priority columns on small screens */
    .calls-table thead th:nth-child(11),
    .calls-table tbody td:nth-child(11), /* Answers of Questions */
    .calls-table thead th:nth-child(13),
    .calls-table tbody td:nth-child(13), /* Call Trigger */
    .calls-table thead th:nth-child(14),
    .calls-table tbody td:nth-child(14), /* Call Type */
    .calls-table thead th:nth-child(15),
    .calls-table tbody td:nth-child(15) { /* Recording URL */
        display: none;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 12px 10px;
    }
    .table-container {
        padding: 14px;
    }
    .calls-table {
        min-width: 700px;
        font-size: 9px;
    }
    .calls-table thead th {
        font-size: 8px;
        padding: 8px 4px;
    }
    .calls-table tbody td {
        font-size: 9px;
        padding: 6px 4px;
    }
    .text-cell,
    .ai-errors-cell,
    .feedback-text-cell,
    .feedback-cell {
        min-width: 80px;
        max-width: 120px;
    }
    /* Further hide details column on very small screens */
    .calls-table thead th:nth-child(10),
    .calls-table tbody td:nth-child(10) { /* Details */
        display: none;
    }
}

/* ========================================
   Mobile-friendly feedback column tweaks
======================================== */
.feedback-text-edit .d-flex {
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
}

.feedback-text-edit .btn {
    white-space: nowrap;
}

.feedback-cell .form-select {
    width: 100%;
}

.calls-table thead th:nth-child(16),
.calls-table tbody td:nth-child(16),
.calls-table thead th:nth-child(17),
.calls-table tbody td:nth-child(17) {
    min-width: 170px;
    white-space: nowrap;
}

.calls-table thead th:nth-child(18),
.calls-table tbody td:nth-child(18),
.calls-table thead th:nth-child(19),
.calls-table tbody td:nth-child(19) {
    min-width: 230px;
}

@media (max-width: 992px) {
    .calls-table {
        min-width: 1150px;
    }
    .feedback-text-cell {
        min-width: 230px;
    }
    .feedback-cell .form-select {
        min-width: 170px;
    }
}

@media (max-width: 768px) {
    .calls-table {
        min-width: 1150px;
    }
    .feedback-cell,
    .feedback-select {
        min-width: 170px;
    }
    .feedback-text-cell {
        min-width: 240px;
    }
}

@media (max-width: 576px) {
    .calls-table {
        min-width: 1150px;
    }
}

/* ========================================
   Login Page Styles
======================================== */
body.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.login-header h1 {
    color: #333;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
    margin-bottom: 0;
}

.login-page .form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.login-page .form-control {
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.login-page .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.login-page .input-group-text {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-right: none;
    border-radius: 10px 0 0 10px;
}

.login-page .input-group .form-control {
    border-left: none;
    border-radius: 0 10px 10px 0;
}

.login-page .input-group:focus-within .input-group-text {
    border-color: #667eea;
}

.btn-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 1.1rem;
    width: 100%;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

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

.login-page .alert {
    border-radius: 10px;
    border: none;
    margin-bottom: 1.5rem;
}

.login-page .alert-success {
    background-color: #d4edda;
    color: #155724;
}

.login-page .alert-error {
    background-color: #f8d7da;
    color: #721c24;
}

.login-page .alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}
