/* ============================================================
   ORC — Old Resian Club · Brand CSS v4
   Colors: Red #C7113D | Gold #D2AE6A | Navy #1B2C53
   ============================================================ */

:root {
  --red:      #C7113D;
  --gold:     #D2AE6A;
  --navy:     #1B2C53;
  --navy-dark:#111D38;
  --white:    #FFFFFF;
  --bg:       #F5F6F8;
  --border:   #E0E2E8;
  --text:     #1A1A2E;
  --muted:    #7A7F9A;
  --success:  #1B7A4A;
  --danger:   #C7113D;
  --radius:   8px;
  --shadow:   0 2px 12px rgba(27,44,83,0.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Montserrat', 'Arial', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ── NAVBAR ─────────────────────────────────────────────── */
.navbar {
  width: 100%;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 60px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-shield {
  width: 32px;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-title {
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 1.5px;
  color: var(--gold);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
  flex: 1;
}

.nav-links a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.8px;
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: all 0.2s;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active { color: var(--white); background: rgba(210,174,106,0.18); }
.nav-links a.active  { color: var(--gold); }

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-username { font-weight: 600; font-size: 13px; color: var(--white); }

.nav-role {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}
.nav-role.admin  { background: var(--gold); color: var(--navy); }
.nav-role.viewer { background: rgba(255,255,255,0.15); color: var(--white); }

.btn-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.8);
  padding: 5px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.btn-logout:hover { background: rgba(199,17,61,0.7); border-color: var(--red); color: var(--white); }

/* ── MAIN CONTENT ────────────────────────────────────────── */
.main-content {
  width: 100%;
  padding: 28px 28px 48px;
}

.full-page { padding: 0; }

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title { font-size: 24px; font-weight: 900; color: var(--navy); letter-spacing: 0.5px; }
.page-sub   { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 2px; }

/* ── ALERTS ─────────────────────────────────────────────── */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 13px;
}
.alert-success { background: #E6F4ED; color: var(--success); border-left: 4px solid var(--success); }
.alert-error   { background: #FDECEA; color: var(--danger);  border-left: 4px solid var(--danger); }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary   { background: var(--red);  color: var(--white); }
.btn-primary:hover { background: #A50E32; }
.btn-secondary { background: var(--navy); color: var(--white); }
.btn-secondary:hover { background: var(--navy-dark); }
.btn-ghost     { background: transparent; color: var(--navy); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--border); }
.btn-full      { width: 100%; justify-content: center; }
.btn-sm        { padding: 7px 14px; font-size: 12px; }
.btn-xs        { padding: 4px 10px;  font-size: 11px; }

/* ── KPI GRID ────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  border-top: 4px solid transparent;
  text-align: center;
  transition: transform 0.2s;
}
.kpi-card:hover     { transform: translateY(-2px); }
.kpi-total          { border-top-color: var(--navy); }
.kpi-fichados       { border-top-color: #C7113D; }
.kpi-pendientes     { border-top-color: var(--gold); }
.kpi-epc            { border-top-color: var(--red); }
.kpi-icon           { font-size: 26px; margin-bottom: 8px; }
.kpi-value          { font-size: 38px; font-weight: 900; color: var(--navy); line-height: 1; }
.kpi-label          { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.8px; margin-top: 6px; text-transform: uppercase; }

/* ── SECTION CARD ────────────────────────────────────────── */
.section-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  width: 100%;
}
.section-card.no-pad { padding: 0; overflow: hidden; }

.section-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: 0.5px;
  margin-bottom: 18px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 16px;
  background: var(--gold);
  border-radius: 2px;
}

/* ── PROGRESS BARS ───────────────────────────────────────── */
.progress-label  { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 600; font-size: 13px; }
.pct-badge       { background: var(--navy); color: var(--white); padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.progress-bar-outer { background: var(--border); border-radius: 20px; height: 12px; overflow: hidden; }
.progress-bar-inner { background: linear-gradient(90deg, var(--navy), var(--red)); height: 100%; border-radius: 20px; transition: width 0.6s ease; }

.mini-progress  { display: flex; align-items: center; gap: 8px; }
.mini-bar       { flex: 1; height: 8px; background: linear-gradient(90deg, var(--navy), var(--red)); border-radius: 20px; transition: width 0.6s ease; }
.mini-pct       { font-size: 11px; font-weight: 700; color: var(--muted); min-width: 36px; text-align: right; }

/* ── MEDIO BARS ──────────────────────────────────────────── */
.medio-bars     { display: flex; flex-direction: column; gap: 10px; }
.medio-row      { display: flex; align-items: center; gap: 12px; }
.medio-name     { min-width: 140px; font-weight: 600; font-size: 13px; }
.medio-bar-outer{ flex: 1; background: var(--border); border-radius: 20px; height: 10px; overflow: hidden; }
.medio-bar-inner{ background: var(--gold); height: 100%; border-radius: 20px; transition: width 0.6s ease; }
.medio-count    { min-width: 28px; font-weight: 700; font-size: 13px; color: var(--navy); text-align: right; }

/* ── DATA TABLE ──────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: auto;
}

.data-table thead th {
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 11px 10px;
  text-align: left;
  white-space: nowrap;
}

.data-table tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
.data-table tbody tr:hover { background: #F0F2F8; }
.data-table tbody tr:last-child { border-bottom: none; }

.data-table td {
  padding: 9px 10px;
  color: var(--text);
  vertical-align: middle;
  word-break: break-word;
}

.data-table .text-center { text-align: center; }
.fw-bold { font-weight: 700; }
.text-muted { color: var(--muted); }

.comentario-cell {
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-style: italic;
}

.empty-row {
  text-align: center;
  color: var(--muted);
  padding: 40px !important;
  font-style: italic;
}

/* ── TABLE WRAPPER — fully fluid, no min-width ───────────── */
.table-desktop {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-desktop .data-table {
  min-width: 0;   /* let the table compress naturally */
  width: 100%;
}

.table-mobile { display: none; }

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-success { background: #D1F0E0; color: var(--success); }
.badge-danger  { background: #FDE8ED; color: var(--danger); }
.badge-gold    { background: #F8F0DC; color: #8B6914; }
.badge-admin   { background: var(--gold); color: var(--navy); }
.badge-viewer  { background: var(--border); color: var(--muted); }

.cat-badge {
  display: inline-block;
  background: #EEF0F8;
  color: var(--navy);
  border: 1px solid #CDD0E0;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ── ACTION BUTTONS ──────────────────────────────────────── */
.actions-cell {
  display: flex;
  gap: 5px;
  align-items: center;
  white-space: nowrap;
}

.btn-action {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.2s;
}
.btn-edit   { background: #EEF0F8; color: var(--navy); }
.btn-edit:hover   { background: var(--navy); color: var(--white); }
.btn-delete { background: #FDE8ED; color: var(--danger); }
.btn-delete:hover { background: var(--danger); color: var(--white); }
.inline-form { display: inline; }

/* ── FILTERS CARD ────────────────────────────────────────── */
.filters-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.filter-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-group-search { flex: 1; min-width: 180px; }

.filter-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  transition: border-color 0.2s;
}
.filter-input:focus { outline: none; border-color: var(--navy); }

.filter-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}

.filter-date {
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  transition: border-color 0.2s;
}
.filter-date:focus { outline: none; border-color: var(--navy); }

.date-range-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.date-sep { color: var(--muted); font-weight: 700; }

/* ── DROPDOWN FILTERS ────────────────────────────────────── */
.dropfilters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.dropfilter { position: relative; }

.dropfilter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.dropfilter-btn:hover              { border-color: var(--navy); background: #EEF0F8; }
.dropfilter-active .dropfilter-btn { background: var(--navy); border-color: var(--navy); color: var(--white); }

.df-count {
  background: var(--red);
  color: var(--white);
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}
.dropfilter-active .df-count { background: var(--gold); color: var(--navy); }

.df-arrow { font-size: 11px; transition: transform 0.2s; }
.dropfilter.open .df-arrow { transform: rotate(180deg); }

.dropfilter-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(27,44,83,0.14);
  padding: 14px;
  z-index: 200;
  min-width: 220px;
  max-width: 340px;
}
.dropfilter-panel-wide { min-width: 300px; }
.dropfilter.open .dropfilter-panel { display: block; }

.df-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ── CHIPS ───────────────────────────────────────────────── */
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.chip input[type=checkbox] { display: none; }
.chip:hover       { border-color: var(--navy); background: #EEF0F8; }
.chip-active      { background: var(--navy); border-color: var(--navy); color: var(--white); }
.chip-static      { cursor: default; pointer-events: none; font-size: 11px; padding: 3px 9px; background: #EEF0F8; border-color: #CDD0E0; }
.chips-sm .chip-static { font-size: 10px; padding: 2px 7px; }
.chips-form .chip { font-size: 13px; padding: 7px 16px; }
.cats-actions     { display: flex; gap: 8px; margin-top: 10px; }

/* ── FORM CARDS ──────────────────────────────────────────── */
.form-card    { max-width: 900px; }
.form-card-sm { max-width: 520px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.form-full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,44,83,0.08);
}
.form-group textarea { resize: vertical; }

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ── INFO BOX ────────────────────────────────────────────── */
.info-box {
  background: #EEF0F8;
  border: 1px solid #CDD0E0;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--navy);
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── LOGIN ───────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  width: 100%;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-wrapper::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(199,17,61,0.12);
  top: -150px; right: -150px;
}
.login-wrapper::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(210,174,106,0.08);
  bottom: -120px; left: -120px;
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
  text-align: center;
}

.login-logo   { margin-bottom: 16px; display: flex; justify-content: center; }
.login-title  { font-size: 22px; font-weight: 900; color: var(--navy); letter-spacing: 2px; margin-bottom: 4px; }
.login-sub    { color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 32px; letter-spacing: 0.5px; }

.login-form { text-align: left; display: flex; flex-direction: column; gap: 16px; }
.login-form .form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.login-form .form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s;
}
.login-form .form-group input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,44,83,0.1);
}
.login-form .btn-primary { margin-top: 8px; padding: 13px; font-size: 14px; letter-spacing: 1.5px; }

/* ── MOBILE PLAYER CARDS ─────────────────────────────────── */
.player-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 1.5px solid var(--border);
  transition: border-color 0.2s;
}
.player-card.open { border-color: var(--navy); }

.player-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  gap: 10px;
}

.player-card-main { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.player-card-name { font-weight: 700; font-size: 14px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-card-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.card-arrow { color: var(--muted); font-size: 12px; transition: transform 0.2s; }
.player-card.open .card-arrow { transform: rotate(180deg); }

.player-card-body { display: none; padding: 0 16px 14px; border-top: 1px solid var(--border); }
.player-card.open .player-card-body { display: block; }

.player-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 12px; }
.player-detail      { display: flex; flex-direction: column; gap: 2px; }
.player-detail-full { grid-column: 1 / -1; }
.pd-label           { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); }

.player-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ── RESPONSIVE ──────────────────────────────────────────── */

/* Tablet */
@media (max-width: 1024px) {
  .main-content { padding: 20px 16px 40px; }
  .kpi-grid     { grid-template-columns: repeat(2, 1fr); }
  .navbar       { padding: 0 16px; gap: 12px; }
}

/* Mobile */
@media (max-width: 767px) {
  .main-content { padding: 14px 10px 32px; }

  /* ── NAVBAR MOBILE ── */
  .navbar {
    padding: 0 10px;
    gap: 4px;
    height: auto;
    min-height: 52px;
    flex-wrap: nowrap;
    overflow: hidden;
  }
  .nav-brand { flex-shrink: 0; gap: 6px; }
  .nav-shield { width: 26px; }
  .nav-title  { display: none; }
  .nav-links  { flex: 1; gap: 0; overflow: hidden; }
  .nav-links a {
    padding: 4px 6px;
    font-size: 10px;
    letter-spacing: 0;
    white-space: nowrap;
  }
  .nav-last-update { display: none; }
  .nav-user {
    flex-shrink: 0;
    gap: 6px;
  }
  .nav-username { display: none; }
  .nav-role     { display: none; }
  .btn-logout {
    padding: 4px 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  /* ── KPI GRID ── */
  .kpi-grid     { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .kpi-value    { font-size: 22px; }
  .kpi-pct      { font-size: 12px; }
  .kpi-label    { font-size: 10px; }
  .kpi-card     { padding: 16px 10px; }
  .kpi-geo svg  { width: 32px; height: 32px; }

  .page-header  { flex-direction: column; align-items: flex-start; }

  /* ── DASHBOARD CATEGORY TABLE — scroll horizontal ── */
  .dash-cat-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cat-compact-table { min-width: 340px; }

  /* ── USUARIOS TABLE — scroll horizontal ── */
  .section-card.no-pad { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .section-card.no-pad .data-table { min-width: 480px; }

  /* Show cards, hide table */
  .table-desktop { display: none; }
  .table-mobile  { display: block; }

  /* Dropfilter panels go full-width on mobile */
  .dropfilter-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    top: auto;
    max-width: 100%;
    min-width: unset;
  }

  .login-card   { padding: 32px 20px; }
  .form-grid    { grid-template-columns: 1fr; }
  .chips-form .chip { font-size: 12px; padding: 6px 12px; }
  .date-range-wrap  { flex-direction: column; align-items: flex-start; }
}

/* ── NAVBAR LAST UPDATE ──────────────────────────────────── */
.nav-last-update {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
  border-left: 1px solid rgba(255,255,255,0.15);
  border-right: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.nav-update-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  line-height: 1;
  margin-bottom: 2px;
}

.nav-update-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.5px;
}

/* ── KPI PERCENTAGE ──────────────────────────────────────── */
.kpi-pct {
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 2px;
  margin-bottom: 2px;
}

/* ── DASHBOARD ROW ───────────────────────────────────────── */
.dash-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 0;
}

.dash-progress { margin-bottom: 0; }

.dash-pie {
  min-width: 260px;
  margin-bottom: 0;
}

/* ── PIE CHART ───────────────────────────────────────────── */
.pie-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.pie-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
}

.pie-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pie-legend-item strong {
  color: var(--navy);
}

/* ── TEXT COLORS ─────────────────────────────────────────── */
.text-success { color: var(--success); }
.text-danger  { color: var(--danger);  }

/* ── RESPONSIVE DASHBOARD ────────────────────────────────── */
@media (max-width: 900px) {
  .dash-bottom-row {
    grid-template-columns: 1fr;
  }
  .dash-pie { min-width: unset; }
}

@media (max-width: 767px) {
  .nav-last-update { display: none; }
  .dash-cat-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── DASHBOARD v6 LAYOUT ─────────────────────────────────── */

/* Override KPI grid to always 3 columns on desktop */
.kpi-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* Bottom row: chart left, table right */
.dash-bottom-row {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items: start;
}

.dash-chart-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dash-cat-card {
  overflow: visible;
}

.dash-cat-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

/* Compact category table */
.cat-compact-table thead th {
  padding: 9px 12px;
  font-size: 10px;
}

.cat-compact-table td {
  padding: 8px 12px;
  font-size: 13px;
}

/* Percentage pill */
.pct-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  min-width: 44px;
  text-align: center;
}
.pct-full { background: #D1F0E0; color: #1B7A4A; }
.pct-high { background: #E8F4D1; color: #4A7A1B; }
.pct-mid  { background: #F8F0DC; color: #8B6914; }
.pct-low  { background: #FDE8ED; color: #C7113D; }

/* Integrated progress bar inside chart card */
.dash-progress-section {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* ── RESPONSIVE DASHBOARD LAYOUT ─────────────────────────── */
@media (max-width: 1024px) {
  .dash-bottom-row {
    grid-template-columns: 260px 1fr;
  }
}

@media (max-width: 767px) {
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .dash-bottom-row {
    grid-template-columns: 1fr;
  }
  .dash-chart-card {
    order: 1;
  }
  .dash-cat-card {
    order: 2;
  }
}

/* ── DASHBOARD CATEGORY FILTER BAR ──────────────────────── */
.dash-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dash-filter-btn {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.dash-filter-btn:hover {
  border-color: var(--navy);
  background: #EEF0F8;
}

.dash-filter-active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* ── KPI GEOMETRIC ICON ──────────────────────────────────── */
.kpi-geo {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

/* ── CATEGORY TABLE ENHANCEMENTS ─────────────────────────── */
.cat-badge-link {
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}
.cat-badge-link:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.dash-cat-highlight {
  background: #F0F2F8 !important;
}
.dash-cat-highlight .cat-badge {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* ── RESPONSIVE FILTER BAR ───────────────────────────────── */
@media (max-width: 767px) {
  .dash-filter-bar {
    padding: 10px 12px;
    gap: 6px;
  }
  .dash-filter-btn {
    font-size: 11px;
    padding: 5px 12px;
  }
}

/* ── CHIP WITH SVG ICON ──────────────────────────────────── */
.chip-icon {
  gap: 7px;
}
.chip-icon svg {
  flex-shrink: 0;
}

/* ── FECHA FICHAJE CASCADING FILTER ──────────────────────── */
.dropfilter-panel-fecha {
  min-width: 260px;
  max-width: 320px;
}

.fecha-step {
  margin-bottom: 12px;
}

.fecha-step:last-of-type {
  margin-bottom: 0;
}

.fecha-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}

.fecha-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #EEF0F8;
  border: 1px solid #CDD0E0;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
}

.fecha-tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  padding: 0;
  font-family: inherit;
  transition: color 0.15s;
}

.fecha-tag-remove:hover {
  color: var(--danger);
}

/* ── PAGE HEADER ACTIONS ─────────────────────────────────── */
.page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── DISABLED CHIP (chained filters) ─────────────────────── */
.chip-disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
  border-color: var(--border);
  background: var(--bg);
  color: var(--muted);
}

.filter-label-hint {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
}

/* ── MOBILE UPDATE BAR ───────────────────────────────────── */
.mobile-update-bar {
  display: none;
}

@media (max-width: 767px) {
  .mobile-update-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--navy-dark);
    padding: 5px 12px;
    border-bottom: 1px solid rgba(210,174,106,0.3);
  }

  .mobile-update-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
  }

  .mobile-update-date {
    font-size: 11px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.5px;
  }
}
