/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #F8FAFC;
    color: #00224C;
    line-height: 1.6;
    font-weight: 400;
}

/* Semantic Colors */
:root {
    /* Nablarise Brand Colors */
    --nablarise-dark: #00224C;
    --nablarise-blue: #002EA3;
    --nablarise-cyan: #00B8FF;
    --nablarise-yellow: #E6E61A;
    --nablarise-white: #FFFFFF;
    
    /* Semantic Status Colors */
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
}

/* Dashboard Layout */
.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: #00224C;
    color: #FFFFFF;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 34, 76, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.header-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.025em;
}

.header h1 i {
    margin-right: 0.75rem;
    color: #00B8FF;
}

.header-subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    margin: 0;
    font-style: italic;
}

.header-info {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

/* File Upload Section */
.file-upload-section {
    padding: 4rem 2rem;
    background: #F8FAFC;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-container {
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.upload-area {
    background: #FFFFFF;
    border: 3px dashed var(--nablarise-cyan);
    border-radius: 12px;
    padding: 3rem 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 2rem;
}

.upload-area:hover {
    border-color: var(--nablarise-blue);
    background: rgba(0, 184, 255, 0.04);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: var(--nablarise-blue);
    background: rgba(0, 184, 255, 0.08);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    color: var(--nablarise-cyan);
    margin-bottom: 1.5rem;
}

.upload-area h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--nablarise-dark);
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: rgba(0, 34, 76, 0.7);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.upload-info {
    background: rgba(0, 46, 163, 0.06);
    border: 1px solid var(--nablarise-blue);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: left;
}

.upload-info p {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--nablarise-dark);
}

.upload-info p:last-child {
    margin-bottom: 0;
}

/* Processing State */
.upload-area.processing {
    border-color: var(--color-warning);
    background: rgba(245, 158, 11, 0.1);
}

.upload-area.processing .upload-icon {
    color: var(--color-warning);
}

.upload-area.success {
    border-color: var(--color-success);
    background: rgba(16, 185, 129, 0.1);
}

.upload-area.success .upload-icon {
    color: var(--color-success);
}

.upload-area.error {
    border-color: var(--color-error);
    background: rgba(239, 68, 68, 0.1);
}

.upload-area.error .upload-icon {
    color: var(--color-error);
}

/* Summary Section */
.summary-section {
    padding: 3rem 2rem;
    background: #FFFFFF;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.card {
    background: #FFFFFF;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 34, 76, 0.06), 0 1px 2px rgba(0, 34, 76, 0.12);
    border: 1px solid rgba(0, 34, 76, 0.06);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.2s ease;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 34, 76, 0.08), 0 2px 4px rgba(0, 34, 76, 0.12);
}

.card.success {
    border-left: 3px solid var(--color-success);
}

.card.error {
    border-left: 3px solid var(--color-error);
}

.card.warning {
    border-left: 3px solid var(--color-warning);
}

.card.info {
    border-left: 3px solid var(--nablarise-blue);
}

.card-icon {
    font-size: 1.75rem;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card.success .card-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.card.error .card-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

.card.warning .card-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.card.info .card-icon {
    background: rgba(0, 46, 163, 0.1);
    color: var(--nablarise-blue);
}

.card-content h3 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #00224C;
    letter-spacing: -0.025em;
}

.card-content p {
    font-weight: 600;
    color: #00224C;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.card-content small {
    font-size: 0.75rem;
    color: rgba(0, 34, 76, 0.6);
    font-weight: 400;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Tabs */
.tab-nav {
    display: flex;
    gap: 0;
    margin-bottom: 3rem;
    border-bottom: 1px solid rgba(0, 34, 76, 0.12);
    overflow-x: auto;
}

.tab-button {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    color: rgba(0, 34, 76, 0.6);
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.tab-button:hover {
    color: #002EA3;
    background: rgba(0, 46, 163, 0.04);
}

.tab-button.active {
    color: #002EA3;
    border-bottom-color: #002EA3;
    background: rgba(0, 46, 163, 0.04);
}

.tab-content {
    display: none;
}

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

/* Overview Grid */
.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2rem;
    height: auto;
}

/* First card spans 2 rows */
.overview-section:nth-child(1) {
    grid-row: 1 / 3;
}

/* Cards 2-5 fill the remaining spaces */
.overview-section:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
}

.overview-section:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
}

.overview-section:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
}

.overview-section:nth-child(5) {
    grid-column: 3;
    grid-row: 2;
}

.overview-section {
    background: #FFFFFF;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 34, 76, 0.06), 0 1px 2px rgba(0, 34, 76, 0.12);
    border: 1px solid rgba(0, 34, 76, 0.06);
}

.overview-section h3 {
    margin-bottom: 2rem;
    color: #00224C;
    font-weight: 700;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.overview-section h3 i {
    color: #002EA3;
    font-size: 1rem;
}

/* Progress Bar */
.progress-bar-container {
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: #f3f4f6;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    transition: width 0.8s ease;
    border-radius: 12px;
}

.progress-fill.success {
    background: linear-gradient(90deg, var(--color-success), #34d399);
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 500;
}

.success-label {
    color: var(--color-success);
}

.error-label {
    color: var(--color-error);
}

/* Stats List */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid var(--color-error);
}

.stats-item-label {
    font-weight: 500;
    color: #374151;
}

.stats-item-value {
    font-weight: 700;
    color: var(--color-error);
}

.stats-item-percentage {
    font-size: 0.85rem;
    color: #6b7280;
    margin-left: 0.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #374151;
}

/* Anomaly Overview */
.anomaly-overview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Equipment Overview */
.equipment-overview {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.equipment-metric {
    text-align: center;
    padding: 1.25rem;
    background: rgba(0, 46, 163, 0.06);
    border-radius: 8px;
    border: 2px solid var(--nablarise-blue);
}

.equipment-type {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.equipment-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--nablarise-dark);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.equipment-ratio {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--nablarise-blue);
}

.equipment-note {
    font-size: 0.75rem;
    color: rgba(0, 34, 76, 0.6);
    font-weight: 500;
    font-style: italic;
}

.equipment-info {
    padding: 1rem;
    background: rgba(0, 34, 76, 0.03);
    border-radius: 6px;
    border: 1px solid rgba(0, 34, 76, 0.12);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    font-size: 0.75rem;
    color: rgba(0, 34, 76, 0.7);
    font-weight: 500;
}

.info-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--nablarise-dark);
}

.anomaly-metric {
    text-align: center;
    padding: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    border: 2px solid var(--color-warning);
}

.anomaly-count {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-warning);
    margin-bottom: 0.25rem;
}

.anomaly-label {
    font-size: 0.9rem;
    color: #d97706;
    font-weight: 500;
}

.max-violation {
    text-align: center;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    color: var(--color-error);
    font-weight: 500;
}

/* Violations List */
.violations-overview {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.violations-overview h3 {
    margin-bottom: 1rem;
    color: #374151;
    font-weight: 600;
}

.violations-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.violation-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid var(--color-warning);
}

.violation-block {
    font-weight: 600;
    color: #374151;
    min-width: 80px;
}

.violation-count {
    font-weight: 700;
    color: var(--color-warning);
    margin-left: auto;
}

.violation-visual {
    flex: 1;
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
    margin: 0 1rem;
}

.violation-fill {
    height: 100%;
    background: var(--color-warning);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Performance Distribution */
.performance-distribution {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.performance-distribution h3 {
    margin-bottom: 1rem;
    color: #374151;
    font-weight: 600;
}

/* Top Slowest Instances */
.top-slowest-instances {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.top-slowest-instances h3 {
    margin-bottom: 1rem;
    color: #374151;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-slowest-instances h3 i {
    color: var(--color-error);
}

.slowest-instances-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.slowest-instance-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid var(--color-error);
    transition: background-color 0.2s ease;
}

.slowest-instance-item:hover {
    background: #f3f4f6;
}

.instance-rank {
    font-weight: 700;
    color: var(--color-error);
    min-width: 30px;
    text-align: center;
    font-size: 0.9rem;
}

.instance-name {
    font-weight: 600;
    color: #374151;
    min-width: 80px;
}

.instance-time {
    font-weight: 700;
    color: var(--color-error);
    margin-left: auto;
    font-size: 1.1rem;
}

.instance-visual {
    flex: 1;
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
    margin: 0 1rem;
}

.instance-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-warning), var(--color-error));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.time-ranges {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.time-range {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.time-range-label {
    font-weight: 500;
    color: #374151;
    min-width: 120px;
}

.time-range-visual {
    flex: 1;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 1rem;
}

.time-range-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.time-range-count {
    font-weight: 700;
    color: #3b82f6;
    min-width: 60px;
    text-align: right;
}

/* Section Headers */
.section-header {
    margin-bottom: 2rem;
    text-align: center;
}

.section-header h2 {
    font-size: 2rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #6b7280;
    font-size: 1.1rem;
}

/* Error Analysis */
.error-analysis {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.error-details {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.breakdown-item {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid var(--color-error);
}

.breakdown-item h4 {
    color: #374151;
    margin-bottom: 0.5rem;
}

.breakdown-item .count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-error);
}

.breakdown-item .percentage {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Anomalies Analysis */
.anomalies-analysis {
    display: grid;
    gap: 2rem;
}

.anomaly-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

/* New Anomaly Card Design */
.anomaly-card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 34, 76, 0.08), 0 2px 4px rgba(0, 34, 76, 0.12);
    border: 1px solid rgba(0, 34, 76, 0.06);
    border-left: 4px solid var(--color-warning);
}

.anomaly-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.anomaly-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--nablarise-dark);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.anomaly-main-metric {
    font-size: 3rem;
    font-weight: 800;
    color: var(--color-warning);
    line-height: 1;
    letter-spacing: -0.025em;
}

.anomaly-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(245, 158, 11, 0.05);
    border-radius: 6px;
    border-left: 3px solid rgba(245, 158, 11, 0.3);
}

.detail-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(0, 34, 76, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.detail-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--nablarise-dark);
}

.metric-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    text-align: center;
}

.metric-card h4 {
    color: #374151;
    margin-bottom: 1rem;
    font-weight: 600;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-warning);
    margin-bottom: 0.5rem;
}

.metric-detail {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

/* Search Controls */
.details-controls, .equipment-search {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.search-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.autocomplete-container {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-controls input {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
    transition: border-color 0.2s ease;
}

.search-controls input:focus {
    outline: none;
    border-color: #4f46e5;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.autocomplete-list.show {
    display: block;
}

.autocomplete-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background-color: #f8f9fa;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item-name {
    font-weight: 600;
    color: #374151;
}

.autocomplete-item-info {
    font-size: 0.85rem;
    color: #6b7280;
}

.autocomplete-item-status {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.autocomplete-item-status.has-equipment {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
}

.autocomplete-item-status.no-equipment {
    background: #f3f4f6;
    color: #6b7280;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-controls input, .filter-controls select {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 200px;
    transition: border-color 0.2s ease;
}

.filter-controls input:focus, .filter-controls select:focus {
    outline: none;
    border-color: #4f46e5;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.btn.primary {
    background: #00B8FF;
    color: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 184, 255, 0.12);
}

.btn.primary:hover {
    background: #0099D6;
    box-shadow: 0 2px 6px rgba(0, 184, 255, 0.18);
    transform: translateY(-1px);
}

.btn.secondary {
    background: #FFFFFF;
    color: #00224C;
    border-color: rgba(0, 34, 76, 0.12);
}

.btn.secondary:hover {
    background: rgba(0, 34, 76, 0.04);
    border-color: #002EA3;
    color: #002EA3;
}

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

/* Performance Metrics */
.performance-metrics {
    display: grid;
    gap: 2rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.metric-stats {
    display: grid;
    gap: 1rem;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
}

.stat-label {
    color: #6b7280;
    font-weight: 500;
}

.stat-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.stat-value.success {
    color: var(--color-success);
}

.stat-value.error {
    color: var(--color-error);
}

/* Table Styles */
.details-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    margin: 1.5rem 0;
}

.instances-table {
    width: 100%;
    border-collapse: collapse;
}

.instances-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.instances-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.instances-table tr:hover {
    background: #f9fafb;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

#page-info {
    color: #6b7280;
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #374151;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    text-align: center;
    color: #4f46e5;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.loading-spinner p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Violation Values */
.violation-value {
    color: var(--color-error);
    font-weight: 700;
}

/* Equipment Details */
.equipment-details {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
    display: none;
}

.equipment-details.show {
    display: block;
}

.equipment-info {
    display: grid;
    gap: 1.5rem;
}

.equipment-type-section {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e5e7eb;
}

.equipment-type-section h4 {
    color: #374151;
    margin-bottom: 1rem;
    font-weight: 600;
}

.equipment-type-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    margin: -1rem -1rem 1rem -1rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    user-select: none;
}

.equipment-type-header:hover {
    background-color: #f3f4f6;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.equipment-count {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.toggle-icon {
    font-size: 0.875rem;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.equipment-type-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

.equipment-item {
    margin-bottom: 2rem;
    padding: 0;
    background: none;
    border: none;
}

.equipment-item.inconsistent {
    background: none;
}

.equipment-item h5 {
    color: #374151;
    margin-bottom: 1rem;
    padding-top: 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.equipment-scenarios {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

/* Modern KPI Card Design */
.scenario-card {
    background: #FFFFFF;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 34, 76, 0.06), 0 1px 2px rgba(0, 34, 76, 0.12);
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 34, 76, 0.06);
}

.scenario-card:hover {
    box-shadow: 0 4px 12px rgba(0, 34, 76, 0.08), 0 2px 4px rgba(0, 34, 76, 0.12);
    transform: translateY(-1px);
}

/* Scenario Label */
.scenario-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #002EA3;
    margin-bottom: 1.25rem;
    text-align: center;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 46, 163, 0.06);
    border-radius: 4px;
    display: inline-block;
    width: 100%;
}

/* Primary KPI - Pressure Values */
.pressure-kpi-section {
    margin-bottom: 1.5rem;
}

.pressure-kpi-primary {
    text-align: center;
    margin-bottom: 1rem;
}

.pressure-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(0, 34, 76, 0.6);
    margin-bottom: 0.5rem;
}

.pressure-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: #00224C;
    letter-spacing: -0.025em;
}

.pressure-value.pressure-aval {
    color: #002EA3;
}

.pressure-unit {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(0, 34, 76, 0.6);
    margin-left: 0.25rem;
}

/* Secondary Pressure (for distribution posts) */
.pressure-kpi-secondary {
    text-align: center;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}

.pressure-kpi-secondary .pressure-value {
    font-size: 1.875rem;
    font-weight: 800;
}

/* Debit KPI */
.debit-kpi {
    text-align: center;
    padding: 0.75rem 0;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 1rem;
}

.debit-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #374151;
    letter-spacing: -0.015em;
    line-height: 1;
}

.debit-unit {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    margin-left: 0.25rem;
}

/* Status and Secondary Metrics */
.equipment-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0;
}

.status-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-icon.open {
    background-color: var(--color-success);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-icon.closed {
    background-color: var(--color-error);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.status-text {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #00224C;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Secondary Metrics */
.secondary-metrics {
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.metric-row:last-child {
    margin-bottom: 0;
}

.metric-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.metric-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    letter-spacing: -0.015em;
}

/* Equipment Type Specific Styles - Removed colored borders */

.consistency-indicator {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.consistency-indicator.consistent {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
}

.consistency-indicator.inconsistent {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .header-title {
        text-align: center;
    }
    
    .file-upload-section {
        padding: 2rem 1rem;
        min-height: 50vh;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .upload-area h3 {
        font-size: 1.25rem;
    }
    
    .summary-section {
        padding: 1rem;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 1rem;
    }
    
    /* Reset grid positioning on mobile */
    .overview-section:nth-child(1),
    .overview-section:nth-child(2),
    .overview-section:nth-child(3),
    .overview-section:nth-child(4),
    .overview-section:nth-child(5) {
        grid-column: auto;
        grid-row: auto;
    }
    
    .overview-section {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .error-analysis {
        grid-template-columns: 1fr;
    }
    
    .tab-nav {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.5rem;
    }
    
    .tab-button {
        min-width: max-content;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-controls input, .filter-controls select,
    .search-controls input {
        min-width: auto;
        width: 100%;
    }
    
    .equipment-scenarios {
        grid-template-columns: 1fr;
    }
    
    .autocomplete-container {
        min-width: auto;
    }
    
    .autocomplete-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .autocomplete-item-status {
        align-self: flex-end;
    }
    
    .scenario-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pressure-values {
        text-align: left;
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .instances-table {
        font-size: 0.9rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .card {
        flex-direction: column;
        text-align: center;
    }
    
    .instances-table th,
    .instances-table td {
        padding: 0.5rem;
    }
    
    .instances-table {
        font-size: 0.8rem;
    }
}