/* Custom styles for Observatorio Regional de Violencia de Junín */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #ffffff;
  color: #1e293b;
  font-feature-settings: "rlig" 1, "calt" 1;
}

html {
  scroll-behavior: smooth;
}

/* Custom scrollbar styled with pink accent */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #ec4899;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #db2777;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Line clamp fallback */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Dashboard de indicadores: cada gráfico contiene su propio desplazamiento. */
html.indicadores-dashboard-page,
html.indicadores-dashboard-page body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

#indicadores-dashboard,
#indicadores-dashboard section,
#active-panel,
#active-charts {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.indicator-chart-frame {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  contain: inline-size;
}

.indicator-chart-scroll {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #f472b6 #f8fafc;
}

.indicator-chart-scroll::-webkit-scrollbar {
  height: 7px;
}

.indicator-chart-scroll::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 999px;
}

.indicator-chart-scroll::-webkit-scrollbar-thumb {
  background: #f9a8d4;
  border-radius: 999px;
}

.indicator-chart-scroll:focus-visible {
  outline: 2px solid #ec4899;
  outline-offset: 3px;
}

.indicator-chart-stage {
  position: relative;
  height: 18rem;
  width: 100%;
  max-width: none;
}

.indicator-chart-stage > canvas {
  display: block;
}

.table-filters { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; min-width: 0; }
.table-filter-label { display: block; flex: 1 1 180px; min-width: 0; max-width: 100%; font-size: .75rem; font-weight: 700; color: #475569; }
.table-filter-label select { display: block; width: 100%; min-width: 0; max-width: 100%; margin-top: .4rem; padding: .65rem .5rem; border: 1px solid #cbd5e1; border-radius: .65rem; background: white; color: #0f172a; text-overflow: ellipsis; }
.indicator-table-link { display: inline-flex; align-items: center; gap: .5rem; margin-top: 1rem; padding: .6rem .8rem; border: 1px solid #f9a8d4; border-radius: .65rem; color: #be185d; background: #fdf2f8; font-size: .8rem; font-weight: 800; }
.indicator-table-link:hover { background: #fce7f3; }
.table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid #e2e8f0; border-radius: 1rem; }
.source-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.source-table th, .source-table td { padding: .8rem 1rem; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: top; min-width: 100px; max-width: 420px; overflow-wrap: anywhere; }
.source-table th { background: #fdf2f8; color: #831843; }
.source-table .selected-measure { background: #fce7f3; font-weight: 700; }
.source-table .source-total { font-weight: 800; background: #f8fafc; }
#table-page { width: 100%; max-width: 1280px; min-width: 0; margin: auto; padding: 2rem 1rem; }
#table-page h1 { overflow-wrap: anywhere; }
#table-page .table-panel { min-width: 0; border: 1px solid #e2e8f0; border-radius: 1.5rem; background: white; padding: 1rem; margin-top: 1.5rem; }

.original-navigation { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .8rem; margin-bottom: 2rem; font-size: .8rem; font-weight: 600; color: #9d174d; }
.original-navigation a:hover { text-decoration: underline; text-underline-offset: 4px; }
.original-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; }
.original-eyebrow { margin-bottom: .65rem; font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: #be185d; }
#table-page .original-page-heading h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.15; color: #172033; }
.original-description { max-width: 38rem; margin-top: .85rem; font-size: .875rem; line-height: 1.7; color: #64748b; }
.original-source-badge { display: inline-flex; flex-shrink: 0; align-items: center; gap: .5rem; border: 1px solid #dce8e1; background: #f5fbf7; border-radius: 999px; padding: .5rem .8rem; color: #32634a; font-size: .7rem; font-weight: 600; }
.original-source-badge > span { width: 6px; height: 6px; border-radius: 50%; background: #479668; }
.original-loading { padding: 3rem 1.5rem; border-radius: 1.25rem; background: white; color: #64748b; }
.original-sheet-section { min-width: 0; max-width: 100%; margin-bottom: 2rem; overflow: hidden; border: 1px solid #e3e7ee; border-radius: 1.25rem; background: white; box-shadow: 0 4px 24px -12px #1e293b26; }
.original-sheet-toolbar { display: flex; align-items: center; gap: 1rem; padding: 1.4rem 1.5rem; }
.original-sheet-icon { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border: 1px solid #f9d8e8; border-radius: .85rem; background: #fdf2f8; color: #be185d; }
.original-sheet-icon svg { width: 21px; height: 21px; }
.original-sheet-source { min-width: 0; }
.original-sheet-kicker { margin-bottom: .2rem; color: #94a3b8; font-size: .6rem; letter-spacing: .12em; font-weight: 700; }
.original-sheet-caption { font-size: .95rem; font-weight: 700; line-height: 1.4; color: #334155; overflow-wrap: anywhere; }
.original-sheet-file { margin-top: .3rem; font-size: .7rem; line-height: 1.5; color: #64748b; overflow-wrap: anywhere; }
.original-sheet-scroll { width: 100%; max-width: 100%; max-height: 72vh; min-width: 0; overflow: auto; overscroll-behavior: contain; background: white; border-top: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; scrollbar-width: thin; scrollbar-color: #d291b0 #f6f2f5; }
.original-sheet-scroll:focus-visible { outline: 3px solid #ec4899; outline-offset: -3px; }
.original-sheet-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.original-sheet-scroll::-webkit-scrollbar-thumb { background: #d291b0; border: 2px solid #f6f2f5; border-radius: 8px; }
.excel-original { border-collapse: separate; border-spacing: 0; table-layout: fixed; min-width: 100%; max-width: none; margin: 0; color: #475569; background: white; }
.excel-original td { padding: .95rem 1.2rem; border: 0; border-bottom: 1px solid #e9edf2; border-right: 1px solid #eef1f5; white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: .8rem; line-height: 1.6; vertical-align: middle; background: white; }
.excel-original tr:nth-child(even) td { background: #f8fafc; }
.excel-original .original-label { font-weight: 600; color: #334155; }
.excel-original .original-number { text-align: right; font-variant-numeric: tabular-nums; }
.excel-original tr:hover td { background: #fff5fa; }
.excel-original tr.original-header-row td { background: #fceef5; color: #831843; font-size: .73rem; font-weight: 700; border-color: #f3dce8; }
.has-sticky-headers .original-header-row td { position: sticky; top: var(--header-top, 0px); z-index: 3; }
.excel-original tr.original-title-row td { padding: 1.15rem 1.25rem; background: #632442; color: white; font-size: .84rem; font-weight: 650; line-height: 1.7; border-color: #632442; text-align: left; }
.original-title-text { display: block; position: relative; z-index: 2; width: var(--title-width, 100%); }
.excel-original tr.original-total-row td { background: #f4e8f0; font-weight: 750; color: #702344; border-top: 1px solid #e6cfdd; border-bottom-color: #e6cfdd; }
.excel-original tr.original-spacer td { height: 18px; padding: 0; border: 0; background: white; }
.original-sheet-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .7rem; padding: .85rem 1.5rem; font-size: .65rem; color: #64748b; background: #fdfdfe; }
.original-scroll-hint { display: none; color: #9d174d; }
.has-overflow .original-scroll-hint { display: inline-flex; gap: .5rem; align-items: center; }
.original-sheet-toolbar .original-scroll-hint { margin-top: .5rem; font-size: .65rem; line-height: 1.5; }
@media (max-width: 639px) {
  .original-page-heading { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .original-sheet-toolbar { padding: 1rem; gap: .75rem; }
  .original-sheet-section { border-radius: 1rem; }
  .original-sheet-bottom { padding: .85rem 1rem; }
  .excel-original td { padding: .8rem 1rem; }
}

@media (max-width: 479px) {
  #overview-kpis {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 639px) {
  .indicator-chart-scroll {
    padding-bottom: 0.25rem;
  }
}
