/* Industrial Dashboard - Design System CSS */
/* "The Orchestrated Engine" Theme v2 */
/* Uses MudBlazor CSS variables for theme compatibility */

/* Material Symbols */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ============================
   ANIMATIONS
   ============================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.95); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ============================
   DASHBOARD CONTAINER
   ============================ */

.industrial-dashboard {
    background: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
    min-height: 100vh;
    font-family: var(--ats-font-ui);
    padding: 0 0.5rem;
}

/* ============================
   PAGE HEADER
   ============================ */

.dashboard-header {
    padding: 1.5rem 0 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid color-mix(in srgb, var(--mud-palette-text-primary) 6%, transparent);
}

.dashboard-header h1 {
    font-family: var(--ats-font-ui);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--mud-palette-text-primary);
    margin: 0 0 0.5rem 0;
}

.dashboard-header .subtitle {
    color: var(--mud-palette-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--mud-palette-surface);
    border: 1px solid color-mix(in srgb, var(--mud-palette-text-primary) 8%, transparent);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    backdrop-filter: blur(8px);
}

.status-badge .pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mud-palette-success);
    box-shadow: 0 0 8px color-mix(in srgb, var(--mud-palette-success) 60%, transparent);
    animation: pulse 2s ease-in-out infinite;
}

/* ============================
   DEVICE CARDS
   ============================ */

.device-card {
    background: var(--mud-palette-surface);
    border: 1px solid color-mix(in srgb, var(--mud-palette-text-primary) 7%, transparent);
    border-radius: 1rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.device-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--mud-palette-primary), var(--mud-palette-info));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.device-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    border-color: color-mix(in srgb, var(--mud-palette-primary) 20%, transparent);
}

.device-card:hover::before {
    opacity: 1;
}

.device-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.device-card-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.device-card-title .material-symbols-outlined {
    font-size: 1.5rem;
    padding: 0.375rem;
    border-radius: 0.5rem;
    background: color-mix(in srgb, currentColor 10%, transparent);
}

.device-card-title .icon {
    font-size: 1.25rem;
}

.device-card-title h2 {
    font-family: var(--ats-font-ui);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
    color: var(--mud-palette-text-primary);
}

.device-card-subtitle {
    font-size: 0.625rem;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* ============================
   HERO METRIC
   ============================ */

.hero-metric {
    text-align: right;
    flex-shrink: 0;
}

.hero-metric-value {
    font-family: var(--ats-font-data);
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
}

.hero-metric-value .unit {
    font-size: 0.875rem;
    font-weight: 700;
    margin-left: 0.25rem;
    opacity: 0.7;
}

.hero-metric-label {
    font-size: 0.625rem;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-top: 0.375rem;
}

/* ============================
   TELEMETRY FIELDS
   ============================ */

.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.625rem;
    margin-bottom: 1rem;
}

.telemetry-field {
    background: var(--mud-palette-background-gray);
    padding: 0.875rem;
    border-radius: 0.625rem;
    border: 1px solid transparent;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.telemetry-field:hover {
    border-color: color-mix(in srgb, var(--mud-palette-text-primary) 10%, transparent);
    background: color-mix(in srgb, var(--mud-palette-surface) 80%, var(--mud-palette-background-gray));
}

.telemetry-field-label {
    font-size: 0.6rem;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 0.375rem;
}

.telemetry-field-value {
    font-family: var(--ats-font-data);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.telemetry-field-value .unit {
    font-size: 0.7rem;
    margin-left: 0.2rem;
    opacity: 0.55;
    font-weight: 600;
}

/* Accent Colors */
.icon-energy, .hero-energy { color: var(--mud-palette-warning); }
.icon-flow, .icon-pressure, .hero-pressure { color: var(--mud-palette-info); }
.icon-environment, .hero-environment { color: var(--mud-palette-success); }
.icon-analog { color: var(--mud-palette-text-secondary); }

.telemetry-field.pressure .telemetry-field-value { color: var(--mud-palette-info); }
.telemetry-field.power .telemetry-field-value { color: var(--mud-palette-warning); }
.telemetry-field.environment .telemetry-field-value { color: var(--mud-palette-success); }

/* ============================
   ENVIRONMENT CARD STYLE
   ============================ */

.env-metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: var(--mud-palette-background-gray);
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.env-metric-row:hover {
    border-color: color-mix(in srgb, var(--mud-palette-success) 20%, transparent);
    transform: translateX(2px);
}

.env-metric-row:last-child {
    margin-bottom: 0;
}

.env-metric-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.env-metric-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    background: color-mix(in srgb, var(--mud-palette-success) 12%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mud-palette-success);
    transition: transform 0.2s ease;
}

.env-metric-row:hover .env-metric-icon {
    transform: scale(1.08);
}

.env-metric-label {
    font-size: 0.625rem;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.env-metric-value {
    font-family: var(--ats-font-data);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}

.env-metric-value .unit {
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
    margin-left: 0.2rem;
}

/* ============================
   MINI SPARKLINE
   ============================ */

.mini-sparkline {
    width: 5.5rem;
    height: 2rem;
    background: color-mix(in srgb, var(--mud-palette-success) 8%, transparent);
    border-radius: 0.375rem;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    padding: 4px;
}

.mini-sparkline .bar {
    flex: 1;
    background: var(--mud-palette-success);
    opacity: 0.3;
    border-radius: 2px 2px 0 0;
    transition: opacity 0.3s ease;
}

.mini-sparkline .bar:last-child {
    opacity: 1;
}

.env-metric-row:hover .mini-sparkline .bar {
    opacity: 0.5;
}

.env-metric-row:hover .mini-sparkline .bar:last-child {
    opacity: 1;
}

/* ============================
   CHART CONTAINER
   ============================ */

.chart-container {
    background: var(--mud-palette-background-gray);
    border-radius: 0.75rem;
    padding: 1rem;
    position: relative;
    width: 100%;
    min-height: 220px;
    border: 1px solid color-mix(in srgb, var(--mud-palette-text-primary) 5%, transparent);
}

.chart-container .mud-chart {
    width: 100% !important;
}

.chart-container .mud-chart svg {
    width: 100% !important;
    height: auto !important;
}

.chart-container .mud-chart-legend {
    display: none !important;
}

.chart-container .mud-chart text {
    font-size: 10px !important;
}

.chart-container svg text {
    font-size: 9px;
    fill: var(--mud-palette-text-secondary);
}

.chart-time-labels {
    display: flex;
    justify-content: space-between;
    padding-top: 0.625rem;
    font-size: 0.625rem;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

/* ============================
   PRESSURE / FLOW HIGHLIGHT
   ============================ */

.pressure-highlight {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--mud-palette-info) 8%, transparent),
        color-mix(in srgb, var(--mud-palette-info) 14%, transparent));
    border: 1px solid color-mix(in srgb, var(--mud-palette-info) 20%, transparent);
    border-radius: 0.875rem;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pressure-value {
    font-family: var(--ats-font-data);
    font-size: 2.75rem;
    font-weight: 900;
    color: var(--mud-palette-info);
    line-height: 1;
    letter-spacing: -0.02em;
}

.pressure-value .unit {
    font-size: 0.875rem;
    margin-left: 0.375rem;
    opacity: 0.6;
    font-weight: 700;
}

.pressure-label {
    font-size: 0.625rem;
    color: var(--mud-palette-info);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-bottom: 0.375rem;
}

.rotating-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    border: 2.5px solid color-mix(in srgb, var(--mud-palette-info) 20%, transparent);
    border-top-color: var(--mud-palette-info);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: rotate 3s linear infinite;
}

.rotating-icon .material-symbols-outlined {
    color: var(--mud-palette-info);
    font-size: 1.25rem;
}

/* ============================
   ANALOG SIGNAL CARD
   ============================ */

.analog-value {
    font-family: var(--ats-font-data);
    font-size: 3rem;
    font-weight: 900;
    color: var(--mud-palette-text-primary);
    text-align: center;
    margin: 1.5rem 0;
    letter-spacing: -0.02em;
}

.analog-value .unit {
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
    margin-left: 0.375rem;
}

.analog-range-bar {
    height: 8px;
    background: var(--mud-palette-background-gray);
    border-radius: 9999px;
    position: relative;
    margin: 1rem 0 1.5rem;
    overflow: hidden;
}

.analog-range-bar .fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--mud-palette-info), var(--mud-palette-primary));
    border-radius: 9999px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.analog-range-bar .marker {
    position: absolute;
    top: -2px;
    height: calc(100% + 4px);
    width: 2px;
    background: color-mix(in srgb, var(--mud-palette-text-primary) 20%, transparent);
    border-radius: 1px;
}

.analog-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
}

.analog-info-item {
    background: var(--mud-palette-background-gray);
    padding: 0.75rem;
    border-radius: 0.625rem;
    border: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.analog-info-item:hover {
    border-color: color-mix(in srgb, var(--mud-palette-text-primary) 10%, transparent);
}

.analog-info-label {
    font-size: 0.5625rem;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.analog-info-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}

.analog-info-value.error {
    color: var(--mud-palette-error);
}

.analog-info-value.success {
    color: var(--mud-palette-success);
}

/* ============================
   CTA BUTTON
   ============================ */

.btn-gradient {
    background: linear-gradient(135deg, var(--mud-palette-primary), var(--mud-palette-primary-darken));
    color: var(--mud-palette-primary-text);
    font-family: var(--ats-font-ui);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--mud-palette-primary) 30%, transparent);
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--mud-palette-primary) 40%, transparent);
}

.btn-gradient:active {
    transform: translateY(0);
}

/* Live Badge */
.live-badge {
    background: color-mix(in srgb, var(--mud-palette-info) 12%, transparent);
    color: var(--mud-palette-info);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid color-mix(in srgb, var(--mud-palette-info) 20%, transparent);
}

/* ============================
   LOADING STATE
   ============================ */

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 1.5rem;
    animation: fadeInUp 0.4s ease;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid color-mix(in srgb, var(--mud-palette-primary) 15%, transparent);
    border-top-color: var(--mud-palette-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================
   BENTO GRID LAYOUT
   ============================ */

.bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.bento-equal {
    min-height: 480px;
    animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Staggered animation for cards */
.bento-equal:nth-child(1) { animation-delay: 0.05s; }
.bento-equal:nth-child(2) { animation-delay: 0.1s; }
.bento-equal:nth-child(3) { animation-delay: 0.15s; }
.bento-equal:nth-child(4) { animation-delay: 0.2s; }
.bento-equal:nth-child(5) { animation-delay: 0.25s; }
.bento-equal:nth-child(6) { animation-delay: 0.3s; }
.bento-equal:nth-child(7) { animation-delay: 0.35s; }
.bento-equal:nth-child(8) { animation-delay: 0.4s; }

.bento-equal .device-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.bento-equal .device-card > *:last-child {
    margin-top: auto;
}

/* Legacy bento classes */
.bento-lg { grid-column: span 1; }
.bento-8 { grid-column: span 1; }
.bento-7 { grid-column: span 1; }
.bento-6 { grid-column: span 1; }
.bento-5 { grid-column: span 1; }
.bento-4 { grid-column: span 1; }

/* ============================
   RESPONSIVE
   ============================ */

@media (max-width: 992px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .industrial-dashboard {
        padding: 0 0.25rem;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .bento-equal {
        min-height: auto;
    }

    .dashboard-header {
        padding: 1rem 0 0.75rem;
    }

    .dashboard-header h1 {
        font-size: 1.5rem;
    }

    .device-card {
        padding: 1.125rem;
        border-radius: 0.875rem;
    }

    .device-card-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-metric {
        text-align: left;
    }

    .hero-metric-value {
        font-size: 2rem;
    }

    .pressure-value {
        font-size: 2rem;
    }

    .analog-value {
        font-size: 2rem;
    }

    .telemetry-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .status-badge {
        font-size: 0.625rem;
        padding: 0.375rem 0.75rem;
    }

    .report-layout {
        grid-template-columns: 1fr;
    }

    .report-form-section {
        grid-template-columns: 1fr;
    }

    .report-actions {
        flex-direction: column;
    }

    .report-actions .btn-gradient,
    .report-actions .btn-outline {
        width: 100%;
        justify-content: center;
    }
}

/* ============================
   REPORTS PAGE
   ============================ */

.report-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.report-card {
    background: var(--mud-palette-surface);
    border: 1px solid color-mix(in srgb, var(--mud-palette-text-primary) 7%, transparent);
    border-radius: 1rem;
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.report-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--mud-palette-primary), var(--mud-palette-info));
    opacity: 0.7;
}

.report-card-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.5rem;
}

.report-card-title .material-symbols-outlined {
    font-size: 1.5rem;
    padding: 0.375rem;
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--mud-palette-primary) 10%, transparent);
    color: var(--mud-palette-primary);
}

.report-card-title h2 {
    font-family: var(--ats-font-ui);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
    color: var(--mud-palette-text-primary);
}

.report-section-label {
    font-size: 0.65rem;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 0.75rem;
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.report-section-label .material-symbols-outlined {
    font-size: 0.875rem;
    opacity: 0.7;
}

.report-section-label:first-child {
    margin-top: 0;
}

.report-form-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.report-form-section.single {
    grid-template-columns: 1fr;
}

.report-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.report-chip {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    border: 1.5px solid color-mix(in srgb, var(--mud-palette-text-primary) 12%, transparent);
    background: transparent;
    color: var(--mud-palette-text-secondary);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.report-chip:hover {
    border-color: color-mix(in srgb, var(--mud-palette-primary) 40%, transparent);
    color: var(--mud-palette-text-primary);
}

.report-chip.active {
    background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
    border-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary);
    font-weight: 700;
}

.report-chip .material-symbols-outlined {
    font-size: 1rem;
}

.report-divider {
    height: 1px;
    background: color-mix(in srgb, var(--mud-palette-text-primary) 6%, transparent);
    margin: 1.25rem 0;
}

.report-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-outline {
    background: transparent;
    color: var(--mud-palette-text-secondary);
    font-family: var(--ats-font-data);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    border: 1.5px solid color-mix(in srgb, var(--mud-palette-text-primary) 15%, transparent);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-outline:hover {
    border-color: var(--mud-palette-text-primary);
    color: var(--mud-palette-text-primary);
    transform: translateY(-1px);
}

/* Summary card on the right */
.report-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
}

.report-summary-item {
    background: var(--mud-palette-background-gray);
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.report-summary-item:hover {
    border-color: color-mix(in srgb, var(--mud-palette-text-primary) 10%, transparent);
}

.report-summary-item .label {
    font-size: 0.6rem;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 0.375rem;
}

.report-summary-item .value {
    font-family: var(--ats-font-data);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}

.report-summary-item.wide {
    grid-column: span 2;
}

.report-info-box {
    background: color-mix(in srgb, var(--mud-palette-info) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--mud-palette-info) 18%, transparent);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.report-info-box .material-symbols-outlined {
    color: var(--mud-palette-info);
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.report-info-box p {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    line-height: 1.5;
}

.report-empty-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    gap: 0.75rem;
    text-align: center;
}

.report-empty-preview .icon-circle {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--mud-palette-background-gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

.report-empty-preview .icon-circle .material-symbols-outlined {
    font-size: 1.5rem;
    color: var(--mud-palette-text-secondary);
    opacity: 0.6;
}

.report-empty-preview p {
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
    font-weight: 600;
}

.report-empty-preview .hint {
    font-size: 0.7rem;
    color: var(--mud-palette-text-disabled);
    font-weight: 500;
}

/* Energy analyzer reports -------------------------------------------------- */
.reports-page {
    max-width: 1440px;
    margin: 0 auto;
}

.reports-page .reports-header,
.reports-page .report-history-heading,
.reports-page .report-history-heading > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ats-sp-4);
}

.reports-page .report-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
    gap: var(--ats-sp-5);
    align-items: start;
}

.reports-page .report-card {
    background: var(--ats-surface);
    border: 1px solid var(--ats-line);
    border-radius: var(--ats-r-md);
    box-shadow: none;
    padding: var(--ats-sp-5);
}

.reports-page .report-card::before {
    display: none;
}

.reports-page .report-card-title {
    display: flex;
    align-items: center;
    gap: var(--ats-sp-3);
    min-height: 32px;
    margin: 0 0 var(--ats-sp-5);
    padding: 0 0 var(--ats-sp-4);
    border-bottom: 1px solid var(--ats-line);
}

.reports-page .report-card-title h2 {
    margin: 0;
    color: var(--ats-ink);
    font-size: var(--ats-t-title);
    font-weight: 600;
}

.reports-page .report-card-title .material-symbols-outlined {
    color: var(--ats-accent);
}

.reports-page .report-field,
.reports-page .report-fieldset {
    display: grid;
    gap: var(--ats-sp-3);
    min-width: 0;
    margin: 0 0 var(--ats-sp-5);
    padding: 0;
    border: 0;
}

.reports-page .report-field > label,
.reports-page .report-fieldset > legend,
.reports-page .report-fieldset-label {
    color: var(--ats-ink-2);
    font-size: var(--ats-t-label);
    font-weight: 600;
}

.reports-page select {
    min-height: 40px;
    padding: 0 var(--ats-sp-4);
    color: var(--ats-ink);
    background: var(--ats-surface);
    border: 1px solid var(--ats-line-strong);
    border-radius: var(--ats-r-sm);
}

.reports-page small,
.reports-page .report-field-note {
    color: var(--ats-ink-3);
    font-size: var(--ats-t-label);
}

.reports-page .report-choice-group,
.reports-page .report-actions,
.reports-page .report-history-filters,
.reports-page .report-history-meta,
.reports-page .report-history-actions,
.reports-page .report-pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ats-sp-3);
}

.reports-page .report-chip,
.reports-page .report-primary-action,
.reports-page .report-secondary-action,
.reports-page .report-cancel-action,
.reports-page .report-icon-action {
    min-height: 36px;
    border-radius: var(--ats-r-sm);
    font-size: var(--ats-t-sm);
    font-weight: 500;
    transition: background-color var(--ats-dur-micro), border-color var(--ats-dur-micro);
}

.reports-page .report-chip {
    padding: 0 var(--ats-sp-4);
    color: var(--ats-ink-2);
    background: var(--ats-surface);
    border: 1px solid var(--ats-line-strong);
}

.reports-page .report-chip:hover,
.reports-page .report-chip.active {
    color: var(--ats-accent-ink);
    background: var(--ats-accent-soft);
    border-color: var(--ats-accent);
}

.reports-page .report-primary-action,
.reports-page .report-secondary-action,
.reports-page .report-cancel-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ats-sp-3);
    padding: 0 var(--ats-sp-4);
}

.reports-page .report-primary-action {
    color: var(--ats-on-accent);
    background: var(--ats-accent);
    border: 1px solid var(--ats-accent);
}

.reports-page .report-secondary-action,
.reports-page .report-cancel-action {
    color: var(--ats-ink);
    background: var(--ats-surface);
    border: 1px solid var(--ats-line-strong);
}

.reports-page .report-cancel-action {
    color: var(--ats-bad);
}

.reports-page button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.reports-page button:focus-visible,
.reports-page select:focus-visible,
.reports-page summary:focus-visible {
    outline: 3px solid var(--ats-focus);
    outline-offset: 2px;
}

.reports-page .report-date-grid,
.reports-page .report-cost-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ats-sp-4);
    margin-bottom: var(--ats-sp-5);
}

.reports-page .report-selection-summary {
    display: grid;
    gap: var(--ats-sp-2);
    margin: var(--ats-sp-5) 0;
    padding: var(--ats-sp-4);
    color: var(--ats-ink-2);
    background: var(--ats-surface-2);
    border: 1px solid var(--ats-line);
    border-radius: var(--ats-r-sm);
    font-size: var(--ats-t-sm);
}

.reports-page .report-selection-summary strong,
.reports-page .report-kpi-grid strong,
.reports-page .report-data-table td:not(:first-child),
.reports-page .report-history-meta {
    font-family: var(--ats-font-data);
    font-variant-numeric: tabular-nums lining-nums;
}

.reports-page .report-validation {
    margin: 0;
    color: var(--ats-bad);
    font-size: var(--ats-t-label);
}

.reports-page .report-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--ats-sp-4);
    min-height: 120px;
    padding: var(--ats-sp-5);
    color: var(--ats-ink-2);
    text-align: left;
}

.reports-page .report-state p {
    margin: var(--ats-sp-1) 0 0;
}

.reports-page .report-state-error {
    color: var(--ats-bad);
    background: var(--ats-bad-soft);
    border: 1px solid color-mix(in srgb, var(--ats-bad) 35%, var(--ats-line));
    border-radius: var(--ats-r-sm);
}

.reports-page .report-inline-notice {
    display: flex;
    align-items: center;
    gap: var(--ats-sp-3);
    padding: var(--ats-sp-4);
    color: var(--ats-warn);
    background: var(--ats-warn-soft);
    border: 1px solid color-mix(in srgb, var(--ats-warn) 35%, var(--ats-line));
    border-radius: var(--ats-r-sm);
}

.reports-page .report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--ats-sp-3);
}

.reports-page .report-kpi-grid article {
    display: grid;
    gap: var(--ats-sp-2);
    min-width: 0;
    padding: var(--ats-sp-4);
    background: var(--ats-surface-2);
    border: 1px solid var(--ats-line);
    border-radius: var(--ats-r-sm);
}

.reports-page .report-kpi-grid span {
    overflow: hidden;
    color: var(--ats-ink-3);
    font-size: var(--ats-t-micro);
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.reports-page .report-kpi-grid strong {
    color: var(--ats-ink);
    font-size: var(--ats-t-title);
    font-weight: 600;
}

/* Grafik kart içinde yaşar; ikinci bir çerçeve açmaz (bkz. DESIGN.md panel kuralı). */
.reports-page .report-chart-block {
    margin-top: var(--ats-sp-5);
    padding-top: var(--ats-sp-4);
    border-top: 1px solid var(--ats-line);
}

.reports-page .report-chart-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--ats-sp-3);
    margin-bottom: var(--ats-sp-3);
}

.reports-page .report-chart-caption {
    color: var(--ats-ink-3);
    font-size: var(--ats-t-micro);
    text-transform: uppercase;
}

.reports-page .report-chart {
    min-width: 0;
    /* ApexCharts kendi yüksekliğini yönetir; sarmalayıcı taşmayı keser. */
    overflow: hidden;
}

.reports-page .report-warnings {
    margin-top: var(--ats-sp-4);
    padding: var(--ats-sp-4);
    color: var(--ats-warn);
    background: var(--ats-warn-soft);
    border-radius: var(--ats-r-sm);
}

.reports-page .report-table-wrap {
    overflow: auto;
    margin-top: var(--ats-sp-5);
    border: 1px solid var(--ats-line);
    border-radius: var(--ats-r-sm);
}

.reports-page .report-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--ats-t-label);
}

.reports-page .report-data-table th,
.reports-page .report-data-table td {
    padding: var(--ats-sp-3) var(--ats-sp-4);
    border-bottom: 1px solid var(--ats-line);
    text-align: right;
    white-space: nowrap;
}

.reports-page .report-data-table th:first-child,
.reports-page .report-data-table td:first-child {
    text-align: left;
}

.reports-page .report-data-table th {
    color: var(--ats-ink-2);
    background: var(--ats-surface-2);
    font-weight: 600;
}

.reports-page .report-data-table .report-quality-reason {
    min-width: 240px;
    max-width: 420px;
    text-align: left;
    white-space: normal;
}

.reports-page .report-quality-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: var(--ats-r-pill);
    color: var(--ats-good);
    background: var(--ats-good-soft);
    font-weight: 600;
}

.reports-page .report-data-table tr:not(.quality-valid) .report-quality-badge {
    color: var(--ats-warn);
    background: var(--ats-warn-soft);
}

.reports-page .report-data-table tr.quality-resetdetected .report-quality-badge,
.reports-page .report-data-table tr.quality-implausiblejump .report-quality-badge {
    color: var(--ats-bad);
    background: var(--ats-bad-soft);
}

.reports-page .report-data-table tr:not(.quality-valid) td {
    background: color-mix(in srgb, var(--ats-warn-soft) 38%, var(--ats-surface));
}

.reports-page .report-history-card {
    margin-top: var(--ats-sp-5);
}

.reports-page .report-history-heading > div {
    justify-content: flex-start;
}

.reports-page .report-history-heading {
    margin-bottom: var(--ats-sp-4);
}

.reports-page .report-history-filters select {
    min-width: 150px;
}

.reports-page .report-history-list {
    display: grid;
    margin-top: var(--ats-sp-4);
    border-top: 1px solid var(--ats-line);
}

.reports-page .report-history-item {
    display: grid;
    grid-template-columns: minmax(200px, 1.2fr) minmax(280px, 2fr) auto;
    gap: var(--ats-sp-4);
    align-items: center;
    padding: var(--ats-sp-4) 0;
    border-bottom: 1px solid var(--ats-line);
}

.reports-page .report-history-main {
    display: grid;
    min-width: 0;
}

.reports-page .report-history-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reports-page .report-history-main span,
.reports-page .report-history-meta {
    color: var(--ats-ink-3);
    font-size: var(--ats-t-label);
}

.reports-page .report-format-badge {
    padding: var(--ats-sp-1) var(--ats-sp-3);
    color: var(--ats-accent-ink);
    background: var(--ats-accent-soft);
    border-radius: var(--ats-r-pill);
}

.reports-page .report-icon-action {
    display: inline-grid;
    place-items: center;
    width: 36px;
    padding: 0;
    color: var(--ats-ink-2);
    background: transparent;
    border: 1px solid var(--ats-line);
}

.reports-page .report-icon-action.danger {
    color: var(--ats-bad);
}

.reports-page .report-pagination {
    justify-content: flex-end;
    margin-top: var(--ats-sp-4);
}

.report-progress-overlay {
    position: fixed;
    z-index: 9999;
    inset: 0;
    display: grid;
    place-items: center;
    padding: var(--ats-sp-5);
    background: color-mix(in srgb, var(--ats-bg) 55%, transparent);
}

.report-progress-panel {
    display: grid;
    justify-items: center;
    gap: var(--ats-sp-4);
    max-width: 360px;
    padding: var(--ats-sp-6);
    color: var(--ats-ink);
    background: var(--ats-surface);
    border: 1px solid var(--ats-line-strong);
    border-radius: var(--ats-r-lg);
    text-align: center;
}

@media (max-width: 960px) {
    .reports-page .report-layout {
        grid-template-columns: 1fr;
    }

    .reports-page .report-history-item {
        grid-template-columns: 1fr auto;
    }

    .reports-page .report-history-meta {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media (max-width: 600px) {
    .reports-page .reports-header,
    .reports-page .report-history-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .reports-page .report-card {
        padding: var(--ats-sp-4);
    }

    .reports-page .report-date-grid,
    .reports-page .report-cost-grid,
    .reports-page .report-kpi-grid {
        grid-template-columns: 1fr;
    }

    .reports-page .report-chart-head {
        align-items: stretch;
        flex-direction: column;
    }

    .reports-page .report-actions > button,
    .reports-page .reports-header > button,
    .reports-page .report-history-filters select {
        width: 100%;
    }

    .reports-page .report-history-item {
        grid-template-columns: 1fr;
        padding: var(--ats-sp-4);
        background: var(--ats-surface-2);
        border: 1px solid var(--ats-line);
        border-radius: var(--ats-r-sm);
    }

    .reports-page .report-history-list {
        gap: var(--ats-sp-3);
        border-top: 0;
    }

    .reports-page .report-history-meta,
    .reports-page .report-history-actions {
        grid-column: auto;
        grid-row: auto;
    }

    .reports-page .report-pagination {
        justify-content: space-between;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reports-page *,
    .report-progress-overlay * {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
