* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Ensure boolean `hidden` attribute always wins (author CSS can otherwise override the UA rule). */
[hidden] {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Left Navigation */
.left-nav {
    width: 280px;
    background: #031428;
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.nav-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-header h2 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.nav-menu {
    list-style: none;
    padding: 12px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-left-color: #fbbf24;
}

.nav-icon {
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
    display: inline-block;
    color: #ffffff;
}

.nav-text {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.nav-arrow {
    margin-left: auto;
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.nav-arrow svg {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.7);
}

.nav-item.collapsed .nav-arrow {
    transform: rotate(-90deg);
}

/* Navigation Submenu */
.nav-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.15);
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-submenu.collapsed {
    max-height: 0;
}

.nav-subitem {
    display: flex;
    align-items: center;
    padding: 10px 20px 10px 60px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-subitem::before {
    content: "●";
    position: absolute;
    left: 45px;
    font-size: 8px;
    color: rgba(255, 255, 255, 0.5);
}

.nav-subitem:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-subitem.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-left-color: #fbbf24;
}

.nav-subitem.active::before {
    color: #fbbf24;
}

.nav-subitem .nav-text {
    font-size: 13px;
    font-weight: 400;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-header {
    background-color: white;
    padding: 20px 32px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.content-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1f2937;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #f3f4f6;
    border-radius: 20px;
    font-size: 14px;
}

.content-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    background-color: #f9fafb;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.content-card h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}

.content-card > p {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 24px;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.info-card {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: 24px;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.info-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-card p {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.info-card.status-good {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left-color: #10b981;
}

.info-card.status-good p {
    color: #065f46;
}

/* Health Check matrix */
.matrix-wrap {
    margin-top: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: auto;
    background: #ffffff;
}

.status-matrix {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 720px;
}

.status-matrix thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f8fafc;
    color: #374151;
    font-size: 12px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.status-matrix th,
.status-matrix td {
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
    border-right: 1px solid #eef2f7;
    text-align: center;
    vertical-align: middle;
}

.status-matrix tr:last-child th,
.status-matrix tr:last-child td {
    border-bottom: none;
}

.status-matrix th:last-child,
.status-matrix td:last-child {
    border-right: none;
}

.status-matrix tbody th {
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    background: #ffffff;
}

.status-matrix tbody td {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.status-matrix tbody td:hover {
    background: #f8fafc;
}

.status-matrix tbody td:focus {
    outline: none;
    box-shadow: inset 0 0 0 3px rgba(59, 130, 246, 0.28);
}

/* Health Check Details */
.health-details {
    display: grid;
    gap: 16px;
}

.health-details-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.hc-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.health-details-heading {
    flex: 1;
    min-width: 260px;
}

.hc-subtitle {
    margin-top: 6px;
    font-size: 14px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hc-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.hc-status-pill.ok {
    color: #065f46;
    background: #d1fae5;
    border-color: #a7f3d0;
}

.hc-status-pill.warn {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fecaca;
}

.hc-status-pill.neutral {
    color: #374151;
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.hc-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.hc-metric {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    background: #ffffff;
}

.hc-metric-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 800;
}

.hc-metric-value {
    margin-top: 8px;
    font-size: 22px;
    font-weight: 900;
    color: #111827;
}

.hc-metric-note {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

.hc-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 12px;
}

.hc-panel {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    background: #ffffff;
}

.hc-panel h4 {
    font-size: 13px;
    font-weight: 900;
    color: #111827;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.hc-chart svg {
    width: 100%;
    height: 140px;
    display: block;
}

.hc-timeline {
    display: grid;
    gap: 10px;
}

.hc-timeline-item {
    display: grid;
    grid-template-columns: 10px 1fr;
    gap: 10px;
    align-items: start;
}

.hc-timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #9ca3af;
    margin-top: 4px;
}

.hc-timeline-dot.ok {
    background: #10b981;
}

.hc-timeline-dot.warn {
    background: #ef4444;
}

.hc-timeline-title {
    font-size: 13px;
    font-weight: 800;
    color: #111827;
}

.hc-timeline-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.status-matrix .sticky-col {
    position: sticky;
    left: 0;
    z-index: 4;
}

.status-matrix thead .sticky-col {
    z-index: 6;
}

.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 14px;
    line-height: 1;
    border: 1px solid transparent;
}

.status-icon.ok {
    color: #065f46;
    background: #d1fae5;
    border-color: #a7f3d0;
}

.status-icon.error {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fecaca;
}

.status-icon.warn {
    color: #d97706;
    background: #fef3c7;
    border-color: #fde68a;
}

.status-icon.neutral {
    color: #6b7280;
    background: #f3f4f6;
    border-color: #e5e7eb;
}

/* Database Runner */
.db-runner {
    margin-top: 16px;
    display: grid;
    gap: 16px;
}

.db-top {
    display: grid;
    gap: 10px;
}

.db-meta {
    font-size: 13px;
    color: #6b7280;
}

.db-params,
.db-results {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    background: #ffffff;
}

.db-params-header h4,
.db-results-bar h4 {
    font-size: 14px;
    font-weight: 800;
    color: #111827;
}

.db-params-form {
    margin-top: 10px;
}

.db-params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.db-param {
    display: grid;
    gap: 6px;
}

.db-param label {
    font-size: 13px;
    font-weight: 700;
    color: #4b5563;
}

.db-input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    background-color: #ffffff;
    color: #1f2937;
}

.db-input.db-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.db-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.db-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.db-results-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.db-table-wrap {
    border: 1px solid #eef2f7;
    border-radius: 10px;
    overflow: auto;
    background: #ffffff;
}

.db-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.db-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #374151;
    padding: 10px 12px;
    text-align: left;
}

.db-table td {
    border-bottom: 1px solid #eef2f7;
    padding: 10px 12px;
    font-size: 13px;
    color: #111827;
    white-space: nowrap;
}

.db-table tr:hover td {
    background: #f9fafb;
}

.db-pagination {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Techops form styling */
.tool-form {
    display: grid;
    gap: 16px;
    margin-top: 8px;
}

.form-row {
    display: grid;
    gap: 8px;
}

.form-row label {
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}

.form-row select,
.form-row textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    background-color: #ffffff;
    color: #1f2937;
}

.health-filter-section .form-row {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 20px;
    vertical-align: top;
}

.health-filter-section .form-row label {
    display: inline-block;
    margin-right: 8px;
    font-size: 13px;
    vertical-align: top;
}

.health-filter-section .form-row select {
    width: auto;
    min-width: 180px;
    max-width: 250px;
    display: inline-block;
    vertical-align: top;
}

.health-filter-section .form-row select[multiple] {
    height: 120px;
}

.form-row textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.1s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn-primary {
    background-color: #3b82f6;
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #111827;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
    transform: translateY(-1px);
}

.btn-tertiary {
    background-color: transparent;
    color: #111827;
    border: 1px solid #d1d5db;
}

.btn-tertiary:hover {
    background-color: #f9fafb;
    transform: translateY(-1px);
}

.status-text {
    font-size: 13px;
    color: #6b7280;
}

.status-text.loading::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid #93c5fd;
    border-top-color: transparent;
    border-radius: 50%;
    margin-right: 8px;
    animation: spin 0.8s linear infinite;
}

.status-text.ok { color: #10b981; }
.status-text.warn { color: #ef4444; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .left-nav {
        width: 70px;
    }

    .nav-text {
        display: none;
    }

    .nav-header h2 {
        font-size: 16px;
        text-align: center;
    }

    .nav-item {
        justify-content: center;
        padding: 16px 10px;
    }

    .nav-icon {
        margin-right: 0;
    }

    .content-header h1 {
        font-size: 22px;
    }

    .content-body {
        padding: 16px;
    }

    .content-card {
        padding: 20px;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Chat Panel Styles */
.chat-panel {
    width: 400px;
    background: white;
    border-left: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

/* Workflow Container Styles */
.workflow-container {
    margin-top: 32px;
    padding: 24px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

/* Use Cases Styles */
.use-cases-container {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.use-cases-container > label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.use-case-btn,
.use-case-btn-cs {
    padding: 12px 16px;
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.use-case-btn:hover,
.use-case-btn-cs:hover {
    border-color: #031428;
    background: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.use-case-btn.active,
.use-case-btn-cs.active {
    background: linear-gradient(135deg, #031428 0%, #052a54 100%);
    color: white;
    border-color: #031428;
    box-shadow: 0 2px 8px rgba(3, 20, 40, 0.3);
}

.use-case-btn.active:hover,
.use-case-btn-cs.active:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(3, 20, 40, 0.4);
}

.workflow-container h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
}

.workflow-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 600px;
    overflow-y: auto;
}

.workflow-step {
    background: white;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.workflow-step.running {
    border-left-color: #3b82f6;
    animation: pulse 2s ease-in-out infinite;
}

.workflow-step.completed {
    border-left-color: #10b981;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    }
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.step-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.step-icon {
    font-size: 18px;
}

.step-timestamp {
    font-size: 12px;
    color: #6b7280;
    font-family: monospace;
}

.step-description {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 8px;
}

.step-status {
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
}

.step-complete {
    color: #10b981;
    font-weight: 600;
}

.step-result {
    margin-top: 12px;
    padding: 12px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    color: #374151;
    border-left: 3px solid #10b981;
}

.step-result strong {
    color: #1f2937;
}

.chat-panel.collapsed {
    transform: translateX(100%);
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #031428 0%, #052a54 100%);
    color: white;
}

.chat-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.chat-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.chat-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.chat-toggle svg {
    width: 20px;
    height: 20px;
    color: white;
    transition: transform 0.3s ease;
}

.chat-panel.collapsed .chat-toggle svg {
    transform: rotate(180deg);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-message {
    display: flex;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.bot {
    justify-content: flex-start;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.chat-message.user .message-content {
    background: linear-gradient(135deg, #031428 0%, #052a54 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.bot .message-content {
    background: white;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.message-content p {
    margin: 0;
}

.chat-input-area {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background: white;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    min-height: 40px;
    transition: border-color 0.2s ease;
}

.chat-input:focus {
    outline: none;
    border-color: #031428;
}

.chat-send {
    background: linear-gradient(135deg, #031428 0%, #052a54 100%);
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.chat-send:hover {
    opacity: 0.9;
}

.chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Responsive adjustments for chat */
@media (max-width: 1024px) {
    .chat-panel {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        z-index: 1000;
    }
    
    .chat-panel.collapsed {
        transform: translateX(100%);
    }
}

/* Alarm Details Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: #f3f4f6;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.alarm-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alarm-item {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    transition: box-shadow 0.2s;
}

.alarm-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.alarm-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.alarm-header .status-icon {
    flex-shrink: 0;
}

.alarm-name {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    flex: 1;
}

.alarm-timestamp {
    font-size: 12px;
    color: #6b7280;
}

.alarm-description {
    font-size: 13px;
    color: #4b5563;
    margin-left: 44px;
    line-height: 1.5;
}

/* External Outages Section */
.outage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.outage-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

.outage-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.last-updated {
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
}

.outage-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0;
}

.outage-tab {
    padding: 12px 24px;
    border: none;
    background: none;
    color: #6b7280;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.outage-tab:hover {
    color: #1f2937;
    background-color: #f9fafb;
}

.outage-tab.active {
    color: #1e40af;
    font-weight: 600;
}

.outage-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #1e40af;
}

.outage-feed {
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
}

.notification-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: #fff;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.notification-toggle:hover {
    border-color: #1e40af;
    color: #1e40af;
    background-color: #f0f4ff;
}

.notification-toggle.enabled {
    border-color: #10b981;
    background-color: #ecfdf5;
    color: #10b981;
}

.notification-toggle svg {
    width: 18px;
    height: 18px;
}

.notification-toggle.enabled svg {
    animation: ring 2s ease-in-out infinite;
}

@keyframes ring {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
    50% { transform: rotate(0deg); }
}

.outage-item {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid transparent;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.outage-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.outage-item.severity-critical {
    border-left-color: #dc2626;
    background-color: #fef2f2;
}

.outage-item.severity-high {
    border-left-color: #ea580c;
    background-color: #fff7ed;
}

.outage-item.severity-medium {
    border-left-color: #f59e0b;
    background-color: #fffbeb;
}

.outage-item.severity-low {
    border-left-color: #10b981;
    background-color: #f0fdf4;
}

.outage-item.severity-resolved {
    border-left-color: #6b7280;
    background-color: #f9fafb;
    opacity: 0.7;
}

.outage-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 16px;
}

.outage-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
}

.outage-severity {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.outage-severity.critical {
    background-color: #dc2626;
    color: white;
}

.outage-severity.high {
    background-color: #ea580c;
    color: white;
}

.outage-severity.medium {
    background-color: #f59e0b;
    color: white;
}

.outage-severity.low {
    background-color: #10b981;
    color: white;
}

.outage-severity.resolved {
    background-color: #6b7280;
    color: white;
}

.outage-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #6b7280;
}

.outage-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.outage-description {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 12px;
}

.outage-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #1e40af;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

.outage-link:hover {
    color: #1e3a8a;
    text-decoration: underline;
}

.outage-regions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.outage-region {
    padding: 4px 10px;
    background-color: #eff6ff;
    color: #1e40af;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6b7280;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #1e40af;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.no-outages {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.no-outages svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    color: #10b981;
}

.no-outages h4 {
    font-size: 18px;
    color: #1f2937;
    margin-bottom: 8px;
}

.no-outages p {
    font-size: 14px;
}

.outage-error {
    text-align: center;
    padding: 40px 20px;
    color: #dc2626;
}

.outage-error svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
}

.outage-error h4 {
    font-size: 16px;
    margin-bottom: 8px;
}

.outage-error p {
    font-size: 14px;
    color: #6b7280;
}

/* ========================================
   Incident Dashboard - Tree Structure
   ======================================== */

.tree-header {
    padding: 12px 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tree-controls {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.tree-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.tree-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.tree-btn:active {
    transform: scale(0.95);
}

.tree-container {
    padding: 8px 0;
    max-height: 500px;
    overflow-y: auto;
}

.product-tree {
    font-size: 13px;
}

.tree-node {
    position: relative;
}

.tree-node-header {
    display: flex;
    align-items: center;
    padding: 6px 12px 6px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.tree-node-header:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.tree-node-indent {
    width: 20px;
    flex-shrink: 0;
}

.tree-expand-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.2s ease;
    font-size: 12px;
    font-weight: bold;
}

.tree-node.expanded > .tree-node-header .tree-expand-icon {
    transform: rotate(90deg);
}

.tree-node.collapsed > .tree-node-header .tree-expand-icon {
    transform: rotate(0deg);
}

.tree-checkbox {
    width: 15px;
    height: 15px;
    margin-right: 8px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #fbbf24;
}

.tree-checkbox:indeterminate {
    opacity: 0.6;
}

.tree-label {
    flex: 1;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    user-select: none;
}

.tree-node-level-1 > .tree-node-header {
    font-weight: 600;
    color: #fbbf24;
}

.tree-node-level-1 > .tree-node-header .tree-label {
    color: #fbbf24;
}

.tree-node-level-2 > .tree-node-header {
    padding-left: 40px;
    font-weight: 500;
}

.tree-node-level-2 > .tree-node-header .tree-label {
    color: rgba(255, 255, 255, 0.85);
}

.tree-node-level-3 > .tree-node-header {
    padding-left: 60px;
    font-weight: 400;
}

.tree-node-level-3 > .tree-node-header .tree-label {
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
}

.tree-node-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.tree-node.expanded > .tree-node-children {
    max-height: 10000px;
}

.tree-node.collapsed > .tree-node-children {
    max-height: 0;
}

.tree-badge {
    background-color: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* ========================================
   Incident Dashboard - Grid
   ======================================== */

.incident-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.incident-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

.filter-summary {
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-summary span {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* EBS Report Table Styles */
.ebs-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.last-refresh-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 14px;
}

.last-refresh-label {
    font-weight: 500;
}

.last-refresh-time {
    color: #374151;
    font-weight: 600;
}

.button-group {
    display: flex;
    gap: 12px;
}

.run-checks-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
}

.run-checks-button:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.run-checks-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.run-checks-icon {
    font-size: 12px;
}

.run-send-report-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.run-send-report-button:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.run-send-report-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.run-send-icon {
    font-size: 14px;
}

.ebs-report-container {
    margin-top: 20px;
    overflow-x: auto;
}

.ebs-report-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.ebs-report-table thead {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.ebs-report-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ebs-report-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.ebs-report-table tbody tr:hover {
    background-color: #f9fafb;
}

.ebs-report-table tbody tr:last-child {
    border-bottom: none;
}

.ebs-report-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: #374151;
}

.ebs-report-table td:first-child {
    font-weight: 600;
    color: #1f2937;
    background: #f3f4f6;
}

.ebs-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.ebs-status-running {
    background: #d1fae5;
    color: #065f46;
}

.ebs-status-ok {
    background: #dbeafe;
    color: #1e40af;
}

.ebs-status-generated {
    background: #fef3c7;
    color: #92400e;
}

.ebs-status-na {
    background: #e5e7eb;
    color: #6b7280;
}

.ebs-status-error {
    background: #fee2e2;
    color: #991b1b;
}

.ebs-status-info {
    background: #e0e7ff;
    color: #3730a3;
}

.grid-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: white;
}

.product-grid {
    min-width: 100%;
    background: white;
}

.product-grid.has-data {
    display: table;
    width: 100%;
    border-collapse: collapse;
}

.grid-header {
    display: table-header-group;
    background-color: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.grid-header-row {
    display: table-row;
}

.grid-header-cell {
    display: table-cell;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
    background-color: #f9fafb;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 11;
}

.grid-body {
    display: table-row-group;
}

.grid-row {
    display: table-row;
    transition: background-color 0.15s ease;
}

.grid-row:hover {
    background-color: #f9fafb;
}

.grid-row:nth-child(even) {
    background-color: #fafafa;
}

.grid-row:nth-child(even):hover {
    background-color: #f3f4f6;
}

.grid-cell {
    display: table-cell;
    padding: 12px 16px;
    font-size: 13px;
    color: #4b5563;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.grid-cell.criticality-hva {
    font-weight: 600;
    color: #dc2626;
}

.grid-cell.criticality-not-hva {
    color: #6b7280;
}

.grid-cell.audience-customer {
    color: #059669;
    font-weight: 500;
}

.grid-cell.audience-non-customer {
    color: #9ca3af;
}

.critical-window-cell {
    max-width: 300px;
    white-space: normal;
    line-height: 1.5;
}

.no-data {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 16px;
    text-align: center;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-hva {
    background-color: #fee2e2;
    color: #dc2626;
}

.badge-not-hva {
    background-color: #f3f4f6;
    color: #6b7280;
}

.badge-customer {
    background-color: #d1fae5;
    color: #059669;
}

.badge-non-customer {
    background-color: #f3f4f6;
    color: #9ca3af;
}

/* Scrollbar styling for tree and grid */
.tree-container::-webkit-scrollbar,
.grid-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.tree-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.tree-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* Incidents Chart Styles */
.chart-container {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-header h4 {
    margin: 0;
    color: #e5e7eb;
    font-size: 16px;
    font-weight: 600;
}

.incidents-chart {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    padding: 20px 10px 10px;
    position: relative;
    gap: 8px;
}

.chart-bars-wrapper {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 8px;
    min-height: 250px;
    padding-bottom: 40px;
}

.incidents-chart .no-data {
    width: 100%;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.chart-bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    max-width: 100px;
}

.chart-bar-wrapper {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
}

.chart-bar-stacked {
    width: 80%;
    display: flex;
    flex-direction: column-reverse;
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 5px;
    overflow: hidden;
}

.chart-bar-segment {
    width: 100%;
    transition: all 0.3s ease;
    cursor: pointer;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.chart-bar-segment:first-child {
    border-top: none;
}

.chart-bar-segment:hover {
    opacity: 0.8;
    filter: brightness(1.2);
}

.chart-bar {
    width: 80%;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
    position: relative;
    min-height: 5px;
    cursor: pointer;
}

.chart-bar:hover {
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
    transform: translateY(-2px);
}

.chart-bar-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: #e5e7eb;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.chart-bar-label {
    margin-top: 8px;
    color: #9ca3af;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Chart Legend */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 15px;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #d1d5db;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.legend-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.legend-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* Pie Charts Container */
.pie-charts-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.pie-chart-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.pie-chart-header {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
}

.pie-chart-header h4 {
    margin: 0;
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 600;
}

.chart-collapse-btn {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chart-collapse-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: scale(1.05);
}

.chart-collapse-btn svg {
    transition: transform 0.3s ease;
}

.chart-collapse-btn.collapsed svg {
    transform: rotate(180deg);
}

.pie-chart-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    max-height: 500px;
    overflow: hidden;
}

.pie-chart-content.collapsed {
    max-height: 0;
    padding: 0 20px;
}

.pie-chart-content canvas {
    max-width: 250px;
    max-height: 250px;
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-height: 150px;
    overflow-y: auto;
}

.pie-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #d1d5db;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pie-legend-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.pie-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.pie-legend-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pie-legend-value {
    font-weight: 600;
    color: #60a5fa;
    margin-left: auto;
}

/* Responsive pie charts */
@media (max-width: 1200px) {
    .pie-charts-container {
        grid-template-columns: 1fr;
    }
    
    .pie-chart-content canvas {
        max-width: 300px;
        max-height: 300px;
    }
}

/* Responsive chart */
@media (max-width: 768px) {
    .incidents-chart {
        overflow-x: auto;
        justify-content: flex-start;
    }
    
    .chart-bar-container {
        min-width: 50px;
    }
}

/* Incident Summary Panel */
.summary-panel {
    position: fixed;
    right: 0;
    top: 60px;
    width: 400px;
    height: calc(100% - 60px);
    background: linear-gradient(135deg, #1a1f35 0%, #0f1419 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 999;
}

.summary-panel.active {
    display: flex;
}

.summary-panel.collapsed {
    transform: translateX(100%);
}

.summary-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.summary-header h3 {
    margin: 0;
    color: #e5e7eb;
    font-size: 16px;
    font-weight: 600;
}

.summary-toggle {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.summary-toggle:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: #93c5fd;
    transform: scale(1.05);
}

.summary-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.summary-panel.collapsed .summary-toggle svg {
    transform: rotate(180deg);
}

.summary-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    color: #d1d5db;
    font-size: 13px;
    line-height: 1.8;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.summary-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #e2e8f0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12px;
    line-height: 1.8;
}

/* Style section headers (=== lines) */
.summary-content pre::first-line {
    font-weight: 700;
    color: #60a5fa;
}

/* Add visual enhancements for different text patterns */
.summary-content {
    background: linear-gradient(to bottom, #1e293b 0%, #0f172a 100%);
}

/* Better text contrast and formatting */
.summary-content pre {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.3px;
}

/* Analysis content formatting */
.analysis-content {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    margin: 20px 0;
    opacity: 0.5;
}

.sub-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #64748b, transparent);
    margin: 12px 0;
    opacity: 0.3;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: #60a5fa;
    text-align: center;
    padding: 15px 0 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

.product-header {
    font-size: 14px;
    font-weight: 700;
    color: #34d399;
    padding: 12px 0 8px;
    border-left: 3px solid #34d399;
    padding-left: 12px;
    margin: 10px 0;
    background: rgba(52, 211, 153, 0.05);
}

.category-header {
    font-size: 13px;
    font-weight: 600;
    color: #fbbf24;
    padding: 10px 0 5px;
    margin-top: 15px;
}

.bullet-point {
    color: #cbd5e1;
    padding: 3px 0 3px 20px;
    position: relative;
}

.bullet-point::before {
    content: '▸';
    position: absolute;
    left: 5px;
    color: #60a5fa;
    font-weight: bold;
}

.list-item {
    color: #94a3b8;
    padding: 3px 0 3px 25px;
    font-size: 12px;
}

.issue-item {
    color: #f87171;
    padding: 3px 0 3px 25px;
    position: relative;
}

.issue-item::before {
    content: '⚠';
    position: absolute;
    left: 5px;
    color: #ef4444;
}

.text-line {
    color: #e2e8f0;
    padding: 2px 0;
    line-height: 1.7;
}

.spacer {
    height: 8px;
}

.summary-content::-webkit-scrollbar {
    width: 8px;
}

.summary-content::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 4px;
}

.summary-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #475569, #334155);
    border-radius: 4px;
}

.summary-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #64748b, #475569);
}

/* Hide chat panel when summary is active */
.chat-panel.hidden {
    display: none;
}

.tree-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.grid-container::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.grid-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.grid-container::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
