
.visit-stats-page-header{margin-bottom:18px}
.visit-stats-page-header h1{margin-bottom:6px}
.visit-stats-page-header p{max-width:760px}

.visit-button-compact{
  min-height:36px!important;
  padding:8px 14px!important;
  width:auto!important;
  flex:0 0 auto!important;
  white-space:nowrap
}

.visit-stats-toolbar{
  padding:0;
  overflow:hidden;
  margin-bottom:26px
}
.visit-stats-toolbar-main{padding:20px 22px 18px}
.visit-stats-toolbar-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  margin-bottom:18px
}
.visit-stats-toolbar-heading h2,
.visit-stats-section-heading h2{
  margin:0 0 5px;
  font-size:1.08rem;
  color:#213548
}
.visit-stats-toolbar-heading p,
.visit-stats-section-heading p{
  margin:0;
  color:#6a7a89;
  line-height:1.45
}
.visit-stats-context{
  display:inline-flex;
  align-items:center;
  min-height:34px;
  padding:7px 12px;
  border:1px solid #d8e1e8;
  border-radius:999px;
  background:#f6f9fb;
  color:#42586a;
  font-size:.84rem;
  font-weight:600;
  white-space:nowrap
}

.visit-stats-filter-row{
  display:grid;
  grid-template-columns:minmax(200px,1.4fr) minmax(160px,.8fr) minmax(160px,.8fr) auto;
  gap:12px;
  align-items:end
}
.visit-stats-filter-row label{
  min-width:0;
  margin:0;
  font-size:.84rem;
  color:#536878;
  font-weight:600
}
.visit-stats-filter-row label select,
.visit-stats-filter-row label input{
  margin-top:6px;
  width:100%
}
.visit-stats-filter-actions{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
  padding-bottom:1px
}

.visit-stats-export-bar{
  min-height:54px;
  padding:10px 18px 10px 22px;
  border-top:1px solid #e4eaef;
  background:#f8fafc;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px
}
.visit-stats-export-label{
  color:#647787;
  font-size:.82rem;
  font-weight:600
}
.visit-stats-actions{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  margin:0
}

.visit-stats-section{margin:0 0 30px}
.visit-stats-section-heading{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-end;
  margin:0 0 13px
}
.visit-stats-kpis{
  gap:12px;
  margin:0
}
.visit-stats-kpis .stat-card{
  min-height:96px;
  padding:16px 18px
}
.visit-stats-kpis .stat-card span{
  line-height:1.3;
  color:#6b7d8d
}
.visit-stats-kpis .stat-card strong{
  margin-top:8px;
  line-height:1.05
}

.visit-stats-highlights{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  margin:0
}
.visit-highlight{
  padding:15px 17px;
  border:1px solid #dce4ea;
  border-radius:12px;
  background:#fff;
  min-height:79px;
  box-shadow:0 1px 2px rgba(24,47,66,.03)
}
.visit-highlight span{
  display:block;
  font-size:.79rem;
  color:#728291;
  margin-bottom:7px;
  line-height:1.25
}
.visit-highlight strong{
  display:block;
  font-size:.98rem;
  color:#263c4f;
  line-height:1.3
}

.visit-charts-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
  margin:0
}
.visit-chart-card{
  min-width:0;
  padding:0;
  overflow:hidden
}
.visit-chart-heading{
  min-height:82px;
  padding:17px 19px 13px;
  border-bottom:1px solid #edf1f4;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px
}
.visit-chart-heading h3,
.visit-table-card h3{
  margin:0 0 6px;
  font-size:1rem;
  color:#24394c
}
.visit-chart-meta{
  margin:0;
  color:#748594;
  font-size:.79rem;
  line-height:1.4
}
.visit-chart-canvas-wrap{
  padding:8px 10px 12px;
  background:#fff
}
.visit-chart-card canvas{
  display:block;
  width:100%;
  height:auto;
  max-height:360px
}

.visit-stats-tables{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px
}
.visit-stats-tables .card{min-width:0}
.visit-table-card{padding:18px 19px}
.visit-table-card h3{margin-bottom:12px}

.visit-mini-table{
  width:100%;
  border-collapse:collapse
}
.visit-mini-table th,
.visit-mini-table td{
  padding:9px 10px;
  border-bottom:1px solid #e8edf1;
  text-align:left
}
.visit-mini-table th{
  color:#647786;
  font-size:.78rem;
  font-weight:700;
  background:#f8fafb
}
.visit-mini-table tbody tr:last-child td{border-bottom:0}
.visit-mini-table th:last-child,
.visit-mini-table td:last-child{text-align:right}

.visit-type-badge{
  display:inline-flex;
  padding:3px 7px;
  border-radius:999px;
  background:#eef3f7;
  font-size:.78rem
}
.visit-state{font-weight:600}
.visit-state-f{color:#217a47}
.visit-state-c{color:#a23a3a}
.visit-state-p,.visit-state-d,.visit-state-a,.visit-state-v{color:#8a6200}

@media(max-width:1120px){
  .visit-stats-filter-row{grid-template-columns:1fr 1fr}
  .visit-stats-filter-actions{justify-content:flex-start}
  .visit-stats-highlights{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:980px){
  .visit-charts-grid,.visit-stats-tables{grid-template-columns:1fr}
}
@media(max-width:720px){
  .visit-stats-toolbar-heading,
  .visit-stats-export-bar{align-items:flex-start;flex-direction:column}
  .visit-stats-context{white-space:normal}
  .visit-stats-filter-row{grid-template-columns:1fr}
  .visit-stats-filter-actions{justify-content:flex-start}
  .visit-stats-highlights{grid-template-columns:1fr}
}
@media print{
  .tenant-sidebar,.topbar,.visit-stats-actions,.visit-stats-filter-row,
  .visit-stats-export-bar,.page-header .button{display:none!important}
  .visit-stats-toolbar{border:0;box-shadow:none}
  .visit-stats-toolbar-main{padding:0 0 14px}
  .visit-stats-toolbar-heading{margin-bottom:0}
  .workspace{display:block!important}
  .panel-view{display:none!important}
  #visitStatsView{display:block!important}
  .main{padding:0!important}
  .visit-charts-grid{grid-template-columns:1fr 1fr}
  .card{break-inside:avoid}
}

/* Tabla de visitas: fecha/hora y procedencia separadas del código postal */
.visit-date-time{display:flex;flex-direction:column;gap:.12rem;white-space:nowrap}
.visit-date-time small{font-size:.78rem;color:#64748b;font-weight:700;line-height:1.15}


/* === ESTADISTICAS 2 PROFESIONAL === */
.visit-stats2-page-header .visit-stats2-kicker{
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  padding:.35rem .7rem;
  border-radius:999px;
  background:#eef4fb;
  color:#48627c;
  font-size:.82rem;
  font-weight:700;
  margin-bottom:.8rem;
}
.visit-stats2-design-card{
  border-radius:1.4rem;
}
.visit-stats2-design-grid{
  display:grid;
  grid-template-columns:minmax(0,1.6fr) minmax(320px,1fr);
  gap:1.25rem;
}
.visit-stats2-design-block,
.visit-stats2-export-block{
  display:flex;
  flex-direction:column;
  gap:1rem;
}
.visit-stats2-block-heading h2{
  margin:0 0 .35rem 0;
}
.visit-stats2-block-heading p{
  margin:0;
  color:#6a7a8a;
}
.visit-stats2-title-row{
  display:grid;
  grid-template-columns:1fr;
}
.visit-stats2-wide-field,
.visit-stats2-color-field{
  display:flex;
  flex-direction:column;
  gap:.45rem;
  font-weight:600;
  color:#3c4f62;
}
.visit-stats2-wide-field input{
  width:100%;
  min-height:2.8rem;
  border:1px solid #cfd8e3;
  border-radius:.95rem;
  padding:0 .9rem;
  background:#fff;
}
.visit-stats2-switches{
  display:flex;
  flex-wrap:wrap;
  gap:1rem 1.4rem;
}
.visit-stats2-check{
  display:inline-flex;
  align-items:center;
  gap:.55rem;
  font-weight:600;
  color:#3c4f62;
}
.visit-stats2-color-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1rem;
}
.visit-stats2-color-field input[type="color"]{
  width:100%;
  min-height:3rem;
  padding:.25rem;
  border:1px solid #cfd8e3;
  border-radius:1rem;
  background:#fff;
}
.visit-stats2-export-actions{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.85rem;
}
.visit-stats2-export-actions .button{
  width:100%;
}
.visit-stats2-export-note{
  padding:.95rem 1rem;
  border:1px dashed #cdd7e2;
  border-radius:1rem;
  background:#fafcff;
  color:#5f7080;
  line-height:1.45;
}
@media (max-width: 1100px){
  .visit-stats2-design-grid{
    grid-template-columns:1fr;
  }
}
@media (max-width: 760px){
  .visit-stats2-color-grid,
  .visit-stats2-export-actions{
    grid-template-columns:1fr;
  }
}


/* === ESTADISTICAS 2 - AJUSTES PROFESIONALES V2 === */
#visitStats2View .visit-stats2-check input[type="checkbox"]{width:18px!important;height:18px!important;min-width:18px!important;min-height:18px!important;max-width:18px!important;max-height:18px!important;margin:0!important;padding:0!important;flex:0 0 18px!important;}
#visitStats2View .visit-stats2-check{display:inline-flex;align-items:center;gap:.5rem;line-height:1.2;}
#visitStats2View .visit-stats2-table-wrap{width:100%;overflow-x:auto;}
#visitStats2View .visit-stats2-table{width:100%;border-collapse:collapse;}
#visitStats2View .visit-stats2-table th,#visitStats2View .visit-stats2-table td{padding:.72rem .8rem;border-bottom:1px solid #e6ebf0;}
#visitStats2View .visit-stats2-table thead th{color:#405365;font-size:.78rem;text-transform:uppercase;letter-spacing:.035em;}
#visitStats2View .visit-stats2-table .is-number{text-align:right;white-space:nowrap;}
#visitStats2View .visit-stats2-table tbody tr:hover{background:#f8fafc;}
#visitStats2View .visit-stats2-table tfoot th{border-top:2px solid #d8e1e9;border-bottom:0;font-weight:800;}
#visitStats2View .visit-stats2-percent{display:inline-flex;justify-content:flex-end;min-width:4.9rem;font-variant-numeric:tabular-nums;}

/* === ESTADISTICAS 2 V3: PNG INDIVIDUAL === */
#visitStats2View .visit-chart-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;}
#visitStats2View .visit-stats2-table-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.75rem;}
#visitStats2View .visit-stats2-table-heading h3{margin:0;}

/* SISDOGAL_VISIT_LIST_V2 */
.visit-list-launch{display:flex;justify-content:flex-end;margin:0 0 18px}
.visit-list-page-header{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;margin-bottom:18px}
.visit-list-page-header h1{margin:16px 0 4px}
.visit-list-page-header p{margin:0}
.visit-list-page-actions{display:flex;gap:10px}
.visit-list-controls{margin-bottom:18px}
.visit-list-filters{display:grid;grid-template-columns:minmax(260px,2fr) minmax(150px,1fr) minmax(150px,1fr);gap:14px;align-items:end}
.visit-list-filters label{display:grid;gap:7px;font-weight:600}
.visit-list-meta{margin-top:12px;font-size:.92rem;color:#637383}
.visit-list-table-card{overflow:hidden}
.visit-list-table-wrap{width:100%;overflow:auto;max-height:72vh;border:1px solid #dfe6ec;border-radius:10px}
.visit-list-table{width:max-content;min-width:100%;border-collapse:separate;border-spacing:0;font-size:.9rem;background:#fff}
.visit-list-table th,.visit-list-table td{padding:10px 12px;border-right:1px solid #e7edf2;border-bottom:1px solid #e7edf2;text-align:left;vertical-align:top;white-space:nowrap}
.visit-list-table th{position:sticky;top:0;z-index:2;background:#f5f8fa;font-weight:700}
.visit-list-table tbody tr:nth-child(even) td{background:#fafcfd}
.visit-list-table tbody tr:hover td{background:#f2f7fa}
@media(max-width:760px){
  .visit-list-page-header{flex-direction:column}
  .visit-list-filters{grid-template-columns:1fr}
  .visit-list-launch{justify-content:stretch}
  .visit-list-launch .button{width:100%}
}


/* SISDOGAL_VISIT_LIST_V3 */
.visit-list-view {
  min-width: 0;
}

.visit-list-view .visit-list-page-header {
  margin-top: 0;
}

.visit-list-table td {
  color: inherit;
}

.visit-list-table th {
  text-transform: none;
}

.visit-list-table td,
.visit-list-table th {
  font-variant-numeric: tabular-nums;
}


/* SISDOGAL_HIDE_OLD_STATS */
button[data-view="visitStats"] {
  display: none !important;
}

.visit-stats2-local-hidden {
  display: none !important;
}
.local-statistics-button {
  white-space: nowrap;
}

.reservation-local-hidden,
.visit-stats2-local-hidden {
  display: none !important;
}


/* SISDOGAL_VISITS_PRO_V1 */
.local-page-back {
  margin-bottom: 18px;
}

.visit-page-filters {
  display: grid;
  grid-template-columns:
    minmax(150px, 1fr)
    minmax(150px, 1fr)
    minmax(150px, 1fr)
    minmax(190px, 1.25fr)
    minmax(170px, 1.15fr);
  gap: 14px;
  align-items: end;
  padding: 20px 22px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #dce4eb);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(29, 50, 74, .06);
  margin-bottom: 14px;
}

.visit-page-filters label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.visit-page-filters select,
.visit-page-filters input[type="date"] {
  width: 100%;
}

.visit-history-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 9px !important;
  min-height: 44px;
  align-self: end;
}

.visit-history-check input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.visit-page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 16px;
}

.visit-page-action-buttons {
  display: flex;
  gap: 10px;
}

.visit-page-context {
  font-weight: 700;
  color: #607080;
}

#reservationsView .table-wrap {
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(29, 50, 74, .06);
}

#reservationsView table th {
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .visit-page-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .visit-page-filters {
    grid-template-columns: 1fr;
  }

  .visit-page-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .visit-page-action-buttons {
    width: 100%;
  }

  .visit-page-action-buttons .button {
    flex: 1;
  }
}

/* SISDOGAL_STATS_EQUAL_DATES_V1 */
#visitStats2View .visit-stats-filter-row{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto!important;gap:14px!important;align-items:end!important}
#visitStats2View .visit-stats-filter-row>label:not(.visit-stats2-local-hidden){min-width:0!important;width:100%!important}
#visitStats2View #visitStats2From,#visitStats2View #visitStats2To{width:100%!important;min-width:0!important;box-sizing:border-box!important}
@media(max-width:760px){#visitStats2View .visit-stats-filter-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}#visitStats2View .visit-stats-filter-actions{grid-column:1/-1!important}}
@media(max-width:520px){#visitStats2View .visit-stats-filter-row{grid-template-columns:1fr!important}#visitStats2View .visit-stats-filter-actions{grid-column:auto!important}}

/* SISDOGAL_VISIT_REPORT_FINAL_V1 */
.visit-report-filters{grid-template-columns:minmax(260px,2fr) minmax(170px,1fr) minmax(170px,1fr)!important}
.visit-report-options{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-top:16px;flex-wrap:wrap}
.visit-report-history-check{display:inline-flex!important;align-items:center;gap:9px;font-weight:700}.visit-report-history-check input{width:18px;height:18px;margin:0}
.visit-report-export-actions{display:flex;gap:10px}.visit-list-local-name{margin:5px 0 3px;font-weight:800;color:#5d6f81}
#visitListView .visit-list-table th:last-child,#visitListView .visit-list-table td:last-child{min-width:260px;white-space:normal}
@media(max-width:760px){.visit-report-filters{grid-template-columns:1fr!important}.visit-report-options{align-items:stretch;flex-direction:column}.visit-report-export-actions{width:100%}.visit-report-export-actions .button{flex:1}}

/* SISDOGAL_VISIT_REPORT_POLISH_V1 */

#visitListView .visit-report-history-check {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 9px !important;
  width: auto !important;
}

#visitListView .visit-report-history-check input[type="checkbox"] {
  flex: 0 0 auto !important;
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
}

#visitListView .visit-report-history-check span {
  display: inline !important;
  white-space: nowrap;
}

#visitListView .visit-list-table th:nth-child(2),
#visitListView .visit-list-table td:nth-child(2),
#visitListView .visit-list-table th:nth-child(3),
#visitListView .visit-list-table td:nth-child(3),
#visitListView .visit-list-table th:nth-child(4),
#visitListView .visit-list-table td:nth-child(4) {
  text-align: center !important;
}

/* SISDOGAL_NAV_POLICY_SINGLE_SOURCE_V2
   CSS no decide permisos ni visibilidad por rol. */
