@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0f1923;
  --card: #1a2736;
  --border: #2a3a4a;
  --text: #e8edf3;
  --muted: #9fb0c3;
  --accent: #4e9af5;
  --success: #2ecc71;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15,25,35,0.75) 0%, rgba(15,25,35,0.92) 100%),
    url('../img/bg-city.jpg') center/cover no-repeat fixed;
  filter: grayscale(100%);
  z-index: -1;
}

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(26, 39, 54, 0.96);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 40px 32px;
  backdrop-filter: blur(14px);
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(78, 154, 245, 0.12);
  color: #b9d7ff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.auth-title {
  margin: 20px 0 10px;
  font-size: 32px;
  line-height: 1.15;
}

.auth-subtitle {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: #d8e2ee;
  font-size: 14px;
  font-weight: 600;
}

.field-hint {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.form-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 25, 35, 0.88);
  color: var(--text);
  padding: 14px 16px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.form-input::placeholder {
  color: #6f8297;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(78, 154, 245, 0.16);
  transform: translateY(-1px);
}

.submit-button {
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #6ab0ff);
  color: #f8fbff;
  padding: 15px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 18px 30px rgba(78, 154, 245, 0.28);
}

.submit-button:hover {
  transform: translateY(-1px);
}

.submit-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.feedback {
  min-height: 22px;
  margin-top: 14px;
  color: #ff9f9f;
  font-size: 14px;
}

.auth-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 8px;
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.55);
}

.upload-page {
  padding: 32px 20px 48px;
}

.upload-main {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.upload-topbar,
.hero-actions,
.card-header-row,
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-back,
.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn-back {
  background: rgba(78, 154, 245, 0.12);
  border: 1px solid rgba(78, 154, 245, 0.35);
  color: #d9e9ff;
}

.btn-back:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
}

.upload-user-badge {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(26, 39, 54, 0.96);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
}

.glass-panel,
.hero-card,
.upload-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(26, 39, 54, 0.96), rgba(15, 25, 35, 0.94));
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-card,
.upload-card {
  padding: 28px;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.section-tag {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(78, 154, 245, 0.12);
  color: #b9d7ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.upload-grid {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 24px;
}

.upload-grid.single-column {
  grid-template-columns: minmax(320px, 640px);
}

.metrics-grid {
  display: grid;
  gap: 16px;
}

.metrics-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric-card strong {
  font-size: 1.4rem;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f5f7fb;
  font-size: 0.85rem;
  font-weight: 600;
}

.pill-badge.muted {
  color: rgba(245, 247, 251, 0.68);
}

.pill-badge.success {
  background: rgba(46, 204, 113, 0.14);
  border-color: rgba(46, 204, 113, 0.35);
  color: #9df0bf;
}

.status-panel {
  padding: 14px 16px;
  border-radius: 16px;
  font-weight: 500;
  border: 1px solid transparent;
}

.status-panel.warning {
  background: rgba(241, 196, 15, 0.12);
  border-color: rgba(241, 196, 15, 0.28);
  color: #ffe08a;
}

.hidden {
  display: none !important;
}

.competencia-selector {
  margin: 18px 0 20px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.competencia-selector-header,
.competencia-selector-actions,
.competencia-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.competencia-selector-header {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.competencia-selector-header h4 {
  margin: 8px 0 0;
}

.competencia-summary {
  color: var(--muted);
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.competencia-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(78, 154, 245, 0.08);
  border: 1px solid rgba(78, 154, 245, 0.18);
  cursor: pointer;
}

.competencia-option input {
  accent-color: var(--accent);
}

.waterfall-card {
  overflow-x: auto;
  padding-top: 8px;
}

.waterfall-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 16px;
  align-items: end;
  min-height: 280px;
}

.waterfall-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.waterfall-bar-wrap {
  width: 100%;
  min-height: 190px;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 0 10px;
}

.waterfall-bar {
  width: 100%;
  max-width: 72px;
  border-radius: 18px 18px 8px 8px;
  box-shadow: inset 0 -10px 18px rgba(255, 255, 255, 0.08);
}

.waterfall-bar.total {
  background: linear-gradient(180deg, #6ab0ff, #4e9af5);
}

.waterfall-bar.positive {
  background: linear-gradient(180deg, #4be28f, #2ecc71);
}

.waterfall-bar.negative {
  background: linear-gradient(180deg, #ff8f8f, #e74c3c);
}

.waterfall-label,
.waterfall-value {
  text-align: center;
}

.waterfall-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.waterfall-value {
  font-size: 0.9rem;
}

.drivers-list,
.insights-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.driver-row,
.insight-item {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.driver-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.driver-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.driver-info span {
  color: var(--muted);
  font-size: 0.9rem;
}

.driver-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
}

.driver-badge.positive {
  background: rgba(46, 204, 113, 0.14);
  color: #9df0bf;
  border: 1px solid rgba(46, 204, 113, 0.35);
}

.driver-badge.negative {
  background: rgba(231, 76, 60, 0.14);
  color: #ffb0a8;
  border: 1px solid rgba(231, 76, 60, 0.35);
}

.insight-item {
  line-height: 1.6;
  color: #dce6f2;
}

@media (max-width: 900px) {
  .driver-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .driver-badge {
    min-width: 0;
  }
}

.status-panel.info {
  background: rgba(78, 154, 245, 0.12);
  border-color: rgba(78, 154, 245, 0.28);
  color: #bfdbfe;
}

.status-panel.success {
  background: rgba(46, 204, 113, 0.12);
  border-color: rgba(46, 204, 113, 0.28);
  color: #bbf7d0;
}

.status-panel.warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(251, 191, 36, 0.28);
  color: #fde68a;
}

.status-panel.error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.28);
  color: #fecaca;
}

.hint-list {
  margin: 18px 0 0;
  padding-left: 18px;
  color: rgba(245, 247, 251, 0.72);
  display: grid;
  gap: 10px;
}

.primary-button,
.secondary-button,
.ghost-button {
  border: none;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), #6ab0ff);
  color: #ffffff;
  box-shadow: 0 16px 40px rgba(78, 154, 245, 0.28);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ghost-button {
  background: transparent;
  color: rgba(248, 250, 252, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.table-wrapper {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.preview-table th,
.preview-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.preview-table th {
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.preview-table td {
  color: #f8fafc;
}

.empty-state-cell {
  text-align: center;
  color: rgba(248, 250, 252, 0.58);
}

.log-card {
  min-height: 220px;
}

.log-output {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}

.log-line {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
}

.log-line.success {
  border-color: rgba(46, 204, 113, 0.24);
}

.log-line.warning {
  border-color: rgba(251, 191, 36, 0.24);
}

.log-line.error {
  border-color: rgba(248, 113, 113, 0.24);
}

@media (max-width: 640px) {
  .auth-card {
    padding: 28px 22px;
    border-radius: 20px;
  }

  .auth-title {
    font-size: 28px;
  }

  .upload-page {
    padding: 20px 14px 32px;
  }
}

@media (max-width: 1080px) {
  .upload-grid {
    grid-template-columns: 1fr;
  }

  .hero-card {
    flex-direction: column;
    align-items: flex-start;
  }
}
/* === EBITDA / Dashboard Screens === */

.filters-bar {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    background: #1a2736;
    border-radius: 12px;
    border: 1px solid #2a3a4a;
    flex-wrap: wrap;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 180px;
    flex: 1 1 180px;
}
.filter-group label {
    font-size: 0.75rem;
    color: #8899aa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}
.filter-group select {
    background: #0f1923;
    color: #e8edf3;
    border: 1px solid #2a3a4a;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-family: Inter, sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    min-height: 44px;
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.highlight-card {
    background: #1a2736;
    border: 1px solid #2a3a4a;
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-height: 100px;
}
.highlight-label { font-size: 0.75rem; color: #8899aa; text-transform: uppercase; }
.highlight-value { font-size: 1.4rem; font-weight: 700; color: #e8edf3; }
.highlight-av { font-size: 0.8rem; color: #8899aa; }
.highlight-var { font-size: 0.85rem; font-weight: 600; }
.highlight-var.positive { color: #2ecc71; }
.highlight-var.negative { color: #e74c3c; }

.section-card {
    background: #1a2736;
    border: 1px solid #2a3a4a;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.section-card h2 {
    font-size: 1.1rem;
    color: #e8edf3;
    margin-bottom: 1rem;
}

.section-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.section-card-header h2 {
    margin: 0;
}

.table-caption {
    color: #8899aa;
    font-size: 0.82rem;
}

.kpi-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.kpi-title-row h2 {
    margin: 0;
}

.kpi-info-button {
    border: none;
    background: transparent;
    color: #9fb0c3;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.kpi-info-button:hover {
    color: #4e9af5;
    transform: scale(1.08);
}

.kpi-info-button:focus-visible,
.kpi-modal-close:focus-visible {
    outline: 2px solid #4e9af5;
    outline-offset: 3px;
}

.kpi-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 13, 19, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 1000;
}

.kpi-modal {
    width: 100%;
    max-width: 520px;
    background: #0f1923;
    border: 1px solid #2a3a4a;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    color: #e8edf3;
    position: relative;
    animation: kpiModalFadeIn 0.22s ease;
}

.kpi-modal-header {
    padding: 1.5rem 1.5rem 0.75rem;
}

.kpi-modal-tag {
    display: inline-flex;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(78, 154, 245, 0.12);
    color: #4e9af5;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.kpi-modal-header h2 {
    margin: 0.9rem 0 0;
    font-size: 1.35rem;
}

.kpi-modal-body {
    padding: 0 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.kpi-modal-section {
    background: #1a2736;
    border: 1px solid #2a3a4a;
    border-radius: 14px;
    padding: 1rem;
}

.kpi-modal-section h3 {
    margin: 0 0 0.55rem;
    font-size: 0.92rem;
    color: #e8edf3;
}

.kpi-modal-section p {
    margin: 0;
    color: #9fb0c3;
    line-height: 1.55;
}

.kpi-benchmark-list,
.kpi-status-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.kpi-benchmark-item,
.kpi-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.kpi-benchmark-label,
.kpi-status-unit {
    font-weight: 600;
    color: #e8edf3;
}

.kpi-benchmark-text,
.kpi-status-value {
    color: #9fb0c3;
    text-align: right;
}

.kpi-status-meta {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.kpi-status-emoji {
    font-size: 1rem;
}

.kpi-modal-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: #1a2736;
    color: #e8edf3;
    font-size: 1.2rem;
    cursor: pointer;
}

@keyframes kpiModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.table-wrapper { overflow-x: auto; }
.dre-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.dre-table th {
    background: #0f1923;
    color: #8899aa;
    padding: 0.6rem 0.8rem;
    text-align: right;
    font-weight: 600;
    border-bottom: 2px solid #2a3a4a;
    white-space: nowrap;
}
.dre-table th:first-child { text-align: left; }
.dre-table td {
    padding: 0.5rem 0.8rem;
    color: #c8d0da;
    border-bottom: 1px solid #1e2d3d;
}
.dre-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.dre-table tr:hover { background: rgba(78,154,245,0.05); }
.dre-subtotal { background: rgba(78,154,245,0.08); }
.dre-subtotal td { font-weight: 700; color: #e8edf3; }
.var-positive { color: #2ecc71 !important; }
.var-negative { color: #e74c3c !important; }

.chart-container { height: 350px; position: relative; }

.insight-item {
    padding: 0.8rem 1rem;
    background: rgba(78,154,245,0.06);
    border-left: 3px solid #4e9af5;
    border-radius: 0 8px 8px 0;
    margin-bottom: 0.5rem;
    color: #c8d0da;
    font-size: 0.9rem;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .highlights-grid { grid-template-columns: repeat(2, 1fr); }
    .filters-bar { flex-direction: column; }
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-grid-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.ai-analysis-content {
    line-height: 1.9;
    font-size: 1.05rem;
    padding: 1.5rem;
    max-width: 960px;
    white-space: pre-wrap;
}

.summary-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2.5rem 1rem;
}

.summary-loader-bar {
    width: 220px;
    height: 4px;
    border-radius: 4px;
    background: #2a3a4a;
    position: relative;
    overflow: hidden;
}

.summary-loader-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, transparent, #4e9af5, transparent);
    animation: summaryLoaderSlide 1.2s ease-in-out infinite;
}

@keyframes summaryLoaderSlide {
    0% { left: -40%; }
    100% { left: 100%; }
}

.summary-loader-text {
    font-size: 0.85rem;
    color: #9fb0c3;
    letter-spacing: 0.02em;
}

.summary-page {
    padding: 32px 20px 48px;
}

.summary-hero,
.summary-panel {
    padding: 28px;
}

.summary-hero-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 1rem;
    width: min(360px, 100%);
}

.summary-hero-stat {
    padding: 1rem 1.1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.summary-hero-stat-label {
    font-size: 0.78rem;
    color: #8899aa;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.summary-hero-stat strong {
    font-size: 1.05rem;
    color: #e8edf3;
}

.summary-title {
    margin: 14px 0 10px;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    color: #e8edf3;
}

.summary-subtitle {
    margin: 0;
    max-width: 760px;
    color: #9fb0c3;
    line-height: 1.6;
}

.summary-kpi-list {
    display: grid;
    gap: 0.85rem;
}

.summary-kpi-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-kpi-copy {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-kpi-label {
    font-size: 0.82rem;
    color: #8899aa;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.summary-kpi-detail {
    font-size: 0.9rem;
    color: #c8d0da;
}

.summary-kpi-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e8edf3;
    text-align: right;
}

.summary-kpi-value.negative {
    color: #e74c3c;
}

.summary-kpi-value.positive {
    color: #2ecc71;
}

.summary-kpi-value.neutral {
    color: #e8edf3;
}

.ai-analysis-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 100%;
}

.ai-analysis-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.ai-analysis-timestamp {
    color: #8899aa;
    font-size: 0.82rem;
}

.ai-analysis-content {
    padding: 1rem 1.1rem;
    border-radius: 14px;
    background: rgba(78,154,245,0.06);
    border: 1px solid rgba(78,154,245,0.18);
    color: #dbe5ef;
    line-height: 1.7;
    white-space: pre-line;
    min-height: 220px;
}

.summary-action-button {
    min-width: 220px;
    padding: 10px 18px;
    border: none;
}

.summary-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-group-actions {
    justify-content: flex-end;
    flex: 0 0 auto;
}

.priority-alerts {
    display: grid;
    gap: 0.85rem;
}

.priority-alert {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.priority-alert strong {
    font-size: 0.95rem;
    color: #e8edf3;
}

.priority-alert span {
    color: #c8d0da;
    line-height: 1.55;
}

.priority-alert.positive {
    border-color: rgba(46, 204, 113, 0.28);
    background: rgba(46, 204, 113, 0.08);
}

.priority-alert.negative {
    border-color: rgba(231, 76, 60, 0.28);
    background: rgba(231, 76, 60, 0.08);
}

.table-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    margin-top: 1rem;
    color: #8899aa;
    font-size: 0.82rem;
    line-height: 1.5;
}

.dre-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

.dre-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.table-wrapper {
    overflow-x: auto;
    max-height: 560px;
}

@media (max-width: 900px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .summary-hero,
    .summary-panel {
        padding: 22px;
    }

    .summary-hero-meta,
    .summary-grid-top {
        grid-template-columns: 1fr;
    }
}
