:root{
  --days-green:#58d68d;
  --days-yellow:#f4d03f;
  --days-orange:#e67e22;
  --days-red:#e74c3c;

  --status-yellow:#f9e79f;
  --status-sky:#85c1e9;
  --status-red:#e74c3c;
  --status-black:#111;
  --content-max: 1200px;
}
body{ font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; background:#f6f8fb; }
.container-max{ max-width: var(--content-max); }
.container-clients-wide{ max-width:1400px; }
.container-proofs-wide{ max-width:1600px; }
.card{ border:0; border-radius:18px; box-shadow:0 10px 30px rgba(0,0,0,.06); }
.navbar{ background:#fff; box-shadow:0 2px 14px rgba(0,0,0,.05); }

.brand-sub{
  font-weight:800;
  letter-spacing:.08em;
  font-size:.85rem;
  color:#111;
  opacity:.9;
}

/* Dashboard gradient cards */
.stat-card{
  display:block;
  text-decoration:none;
  color:#fff;
  padding:18px;
  border-radius:22px;
  box-shadow:0 14px 34px rgba(0,0,0,.14);
  transition:transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.stat-card .text-muted,
.stat-card .small.text-muted{ color:rgba(255,255,255,.85)!important; }
.stat-card .fw-bold{ color:#fff; }
.stat-card i{ color:rgba(255,255,255,.95); opacity:.95; }
.stat-card:hover{ transform:translateY(-2px); filter:brightness(.98); box-shadow:0 18px 40px rgba(0,0,0,.18); }
.stat-card:active{ transform:translateY(0); }

.gradient-clients{ background:linear-gradient(90deg,#ffb347,#ff5a5f); }
.gradient-payments{ background:linear-gradient(90deg,#34d399,#10b981); }
.gradient-sales{ background:linear-gradient(90deg,#7c3aed,#2563eb); }
.gradient-packages{ background:linear-gradient(90deg,#3b82f6,#06b6d4); }
.btn-nav{ border-radius:25px; padding:.25rem .9rem; font-weight:600; }
.badge-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:20px;
  padding:6px 10px;
  font-weight:700;
  box-shadow:0 6px 10px rgba(0,0,0,.08);
}
.days-green{ background:var(--days-green); color:#0b2e13; }
.days-yellow{ background:var(--days-yellow); color:#3a2f00; }
.days-orange{ background:var(--days-orange); color:#fff; }
.days-red{ background:var(--days-red); color:#fff; }

.status-paid{ background:var(--status-sky); color:#0b2e13; }
.status-pending{ background:var(--status-yellow); color:#3a2f00; }
.status-late{ background:var(--status-red); color:#fff; }
.status-cancelled{ background:var(--status-black); color:#fff; }

.pill-status{ min-width:110px; text-align:center; }
.pill-days{ min-width:46px; text-align:center; }

.table thead th{ border-bottom:0; color:#2c3e50; }
.table tbody tr{ background:#fff; border-radius:14px; }
.table tbody td{ vertical-align:middle; }
.table-hover tbody tr:hover{ background:#f3f7ff; }

/* Dashboard table header like the mock */
.table-dashboard{ border-collapse:separate; border-spacing:0; }
.table-dashboard thead th{
  background:#0d6efd;
  color:#fff;
  padding:.85rem .9rem;
}
.table-dashboard thead th:first-child{ border-top-left-radius:14px; }
.table-dashboard thead th:last-child{ border-top-right-radius:14px; }
.table-dashboard tbody tr:first-child td{ border-top:0; }

.action-btn{
  width:36px; height:36px;
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:12px;
  border:0;
  color:#fff;
}
.action-btn i{ font-size:1.1rem; }
.action-edit{ background:#3498db; }
.action-pay{ background:#27ae60; }
.action-print{ background:#34495e; }
.action-ticket{ background:#16a085; }
.action-history{ background:#8e44ad; }
.action-del{ background:#e74c3c; }
.action-wa{ background:#25D366; }

.form-control, .form-select{ border-radius:14px; }
.modal-content{ border-radius:18px; border:0; }
footer.small{ color:#6c757d; }

@media (max-width: 768px){
  .table-responsive{ border-radius:18px; }
  .action-btn{ width:40px; height:40px; }
}


.btn-nav-notif{
  background:#ffc107 !important;
  color:#fff;
  border:2px solid #f4d03f; /* borde amarillo/naranja para la campana */
}
.btn-nav-notif:hover{
  filter:brightness(.95);
  color:#fff;
}

.btn-view{
  background:#0d6efd;
  color:#fff;
  border:0;
  border-radius:12px;
  padding:.35rem .7rem;
  font-weight:700;
}
.btn-view:hover{ filter:brightness(.95); color:#fff; }

/* Navbar estilo "tabs" */
.nav-main-link{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  padding:.65rem .75rem;
  border-radius:14px;
  color:#2c3e50;
  font-weight:700;
  text-decoration:none;
}
.nav-main-link:hover{ background:#f3f7ff; color:#1f5eff; }
.nav-main-link.active{
  background:#eaf2ff;
  color:#1f5eff;
  position:relative;
}
.nav-main-link.active::after{
  content:"";
  position:absolute;
  left:10px; right:10px; bottom:-2px;
  height:3px;
  border-radius:4px;
  background:#1f5eff;
}
.navbar .nav-item{ display:flex; align-items:center; }

.days-black{background:#000!important;color:#fff!important;}

/* Clients redesign */
.clients-page{ margin-top:-.25rem; }
.clients-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1.25rem;
}
.clients-title{ font-size:1.9rem; font-weight:800; letter-spacing:-.04em; color:#13213c; }
.clients-subtitle{ color:#66789b; font-size:1rem; }
.clients-toolbar-actions{ display:flex; align-items:center; gap:.9rem; }
.client-search{
  min-width:330px;
  height:50px;
  display:flex;
  align-items:center;
  gap:.75rem;
  padding:0 1rem;
  border:1px solid #dce4f2;
  border-radius:15px;
  background:#fff;
  box-shadow:0 8px 24px rgba(30,58,108,.04);
}
.client-search > i{ color:#7183a6; }
.client-search input{
  min-width:0;
  flex:1;
  border:0;
  outline:0;
  background:transparent;
  color:#22304b;
}
.client-search input::placeholder{ color:#8997b2; }
.client-search-clear{ color:#8a99b2; }
.clients-add-btn{
  height:50px;
  border-radius:15px;
  display:inline-flex;
  align-items:center;
  gap:.55rem;
  padding:0 1.25rem;
  font-weight:800;
  box-shadow:0 10px 22px rgba(13,110,253,.22);
}
.client-filters{
  display:flex;
  gap:.7rem;
  overflow-x:auto;
  padding:.2rem 0 .45rem;
  scrollbar-width:thin;
}
.client-filter{
  --filter-color:#0d6efd;
  flex:0 0 auto;
  min-height:48px;
  display:inline-flex;
  align-items:center;
  gap:.58rem;
  padding:.55rem .9rem;
  border:1px solid #e2e8f3;
  border-radius:14px;
  color:#20304f;
  background:#fff;
  text-decoration:none;
  font-weight:750;
  box-shadow:0 6px 20px rgba(35,61,108,.035);
  transition:.15s ease;
}
.client-filter:hover{ transform:translateY(-1px); color:#20304f; border-color:#cfd9eb; }
.client-filter i{ color:var(--filter-color); font-size:1rem; }
.client-filter strong{
  min-width:22px;
  height:22px;
  padding:0 6px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:color-mix(in srgb, var(--filter-color) 12%, white);
  color:var(--filter-color);
  font-size:.75rem;
}
.client-filter.active{
  border-color:color-mix(in srgb, var(--filter-color) 60%, white);
  box-shadow:0 7px 20px color-mix(in srgb, var(--filter-color) 12%, transparent);
}
.filter-blue{ --filter-color:#1672f8; }
.filter-amber{ --filter-color:#e59b08; }
.filter-green{ --filter-color:#22a860; }
.filter-red{ --filter-color:#f04f4f; }
.filter-cyan{ --filter-color:#00aebd; }
.filter-purple{ --filter-color:#8b4fe8; }
.client-list{ display:flex; flex-direction:column; gap:.72rem; }
.client-row-card{
  display:grid;
  grid-template-columns:minmax(245px,1.45fr) minmax(130px,.75fr) minmax(160px,.9fr) 92px 125px minmax(165px,.9fr) auto;
  align-items:center;
  gap:1rem;
  min-height:102px;
  padding:1rem 1.05rem;
  border:1px solid #edf1f7;
  border-radius:18px;
  background:#fff;
  box-shadow:0 8px 25px rgba(24,50,92,.055);
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.client-row-card:hover{
  transform:translateY(-1px);
  border-color:#dfe7f3;
  box-shadow:0 12px 30px rgba(24,50,92,.08);
}
.client-row-card.client-cancelled{ opacity:.68; }
.client-identity{ display:flex; align-items:center; gap:.95rem; min-width:0; }
.client-avatar{
  width:58px;
  height:58px;
  flex:0 0 58px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  font-size:1.05rem;
  font-weight:900;
  letter-spacing:.02em;
}
.avatar-mint{ background:#d9f5eb; color:#06765f; }
.avatar-sand{ background:#fff0d2; color:#8a5d00; }
.avatar-violet{ background:#ebe0ff; color:#6030b6; }
.avatar-pink{ background:#ffe0ec; color:#bc2d65; }
.avatar-sky{ background:#dff1ff; color:#106a9f; }
.client-main-info{ min-width:0; }
.client-name{ font-size:1.03rem; font-weight:850; color:#13213c; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.client-number{ margin-top:.08rem; color:#6f7e99; font-size:.79rem; }
.client-ip{ display:flex; align-items:center; gap:.4rem; margin-top:.2rem; min-width:0; color:#74839e; font-size:.85rem; }
.client-ip a{ color:#075ff0; font-weight:700; text-decoration:none; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.client-data-cell{ min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:.18rem; color:#182641; }
.client-data-cell strong{ font-size:.92rem; }
.client-data-cell small{ color:#697997; }
.client-data-label{ display:block; color:#687896; font-size:.68rem; font-weight:800; letter-spacing:.01em; }
.client-date{ display:flex; align-items:center; gap:.45rem; font-size:.84rem; color:#263653; white-space:nowrap; }
.client-date i{ color:#6f80a0; }
.client-days-wrap{ display:flex; flex-direction:column; align-items:flex-start; gap:.38rem; }
.client-days{
  width:42px;
  height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  font-size:.9rem;
  font-weight:900;
  box-shadow:none;
}
.client-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:92px;
  min-height:34px;
  padding:.38rem .65rem;
  border-radius:9px;
  font-size:.72rem;
  font-weight:900;
  border:1px solid transparent;
}
.client-status.status-paid{ background:#e8f6ff; color:#08689d; border-color:#86cff7; }
.client-status.status-pending{ background:#fff8e7; color:#b36c00; border-color:#ffc766; }
.client-status.status-late{ background:#fff0ef; color:#ef4545; border-color:#ff9691; }
.client-status.status-cancelled{ background:#f1f2f4; color:#30343a; border-color:#b9bec6; }
.client-billing{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  min-height:34px;
  padding:.38rem .68rem;
  border-radius:9px;
  font-size:.74rem;
  font-weight:850;
  white-space:nowrap;
  border:1px solid;
}
.billing-recharge{ color:#008b9e; background:#ecfdff; border-color:#42cbd5; }
.billing-subscription{ color:#7335c4; background:#f7f0ff; border-color:#be8bff; }
.client-actions{ display:flex; justify-content:flex-end; align-items:center; gap:.42rem; }
.client-action-btn{
  width:42px;
  height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:12px;
  color:#fff;
  text-decoration:none;
  transition:filter .15s ease, transform .15s ease;
}
.client-action-btn:hover{ color:#fff; filter:brightness(.96); transform:translateY(-1px); }
.client-action-btn.action-edit{ background:#2d9dd8; }
.client-action-btn.action-pay{ background:#20aa62; }
.client-action-btn.action-more{ background:#fff; color:#536580; border:1px solid #dce4ef; }
.client-action-btn.action-more:hover{ color:#263a59; }
.client-actions-menu{ min-width:220px; padding:.5rem; border:0; border-radius:14px; box-shadow:0 14px 35px rgba(22,42,76,.16); }
.client-actions-menu .dropdown-item{ display:flex; align-items:center; gap:.65rem; border-radius:9px; padding:.58rem .65rem; font-size:.88rem; }
.client-empty{
  padding:3rem 1.25rem;
  text-align:center;
  border:1px dashed #ccd7e7;
  border-radius:18px;
  background:#fff;
}
.client-empty-icon{
  width:60px;
  height:60px;
  margin:0 auto 1rem;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:18px;
  background:#edf4ff;
  color:#176df2;
  font-size:1.6rem;
}
.client-empty p{ color:#71809b; }

@media (max-width: 1199px){
  .client-row-card{
    grid-template-columns:minmax(230px,1.4fr) minmax(130px,.8fr) minmax(155px,.9fr) 78px minmax(145px,.8fr) auto;
  }
  .client-status-cell{ display:none; }
}
@media (max-width: 991px){
  .clients-toolbar{ align-items:flex-start; }
  .clients-toolbar-actions{ width:100%; max-width:520px; }
  .client-search{ flex:1; min-width:0; }
  .client-row-card{
    grid-template-columns:minmax(240px,1.45fr) minmax(140px,.8fr) 76px minmax(160px,.9fr) auto;
  }
  .client-date-cell{ display:none; }
}
@media (max-width: 767px){
  .clients-toolbar{ flex-direction:column; }
  .clients-toolbar-actions{ max-width:none; }
  .clients-add-btn span{ display:none; }
  .clients-add-btn{ width:50px; padding:0; justify-content:center; flex:0 0 50px; }
  .client-row-card{
    grid-template-columns:1fr auto;
    grid-template-areas:
      "identity actions"
      "package days"
      "date date"
      "status billing";
    gap:.9rem 1rem;
    padding:1rem;
  }
  .client-identity{ grid-area:identity; }
  .client-actions{ grid-area:actions; align-self:start; }
  .client-package-cell{ grid-area:package; display:flex; }
  .client-date-cell{ grid-area:date; display:flex; padding-top:.75rem; border-top:1px solid #edf1f6; }
  .client-days-wrap{ grid-area:days; justify-self:end; }
  .client-status-cell{ grid-area:status; display:flex; }
  .client-billing-cell{ grid-area:billing; display:flex; align-items:flex-end; justify-self:end; }
  .client-action-btn{ width:38px; height:38px; }
  .client-action-btn.action-pay{ display:none; }
}
@media (max-width: 480px){
  .client-search{ min-width:0; }
  .clients-title{ font-size:1.65rem; }
  .client-avatar{ width:50px; height:50px; flex-basis:50px; }
  .client-row-card{
    grid-template-areas:
      "identity actions"
      "package days"
      "date date"
      "status status"
      "billing billing";
  }
  .client-billing-cell{ justify-self:start; align-items:flex-start; }
}

/* Settings: timezone and automatic blocking */
.settings-section-card{
  padding:1rem;
  border:1px solid #dfe7f3;
  border-radius:16px;
  background:#f8fbff;
}
.settings-section-icon{
  width:42px;
  height:42px;
  flex:0 0 42px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:13px;
  background:#e8f1ff;
  color:#176df2;
  font-size:1.1rem;
}
.settings-time-preview{
  display:flex;
  align-items:flex-start;
  gap:.55rem;
  padding:.7rem .8rem;
  border-radius:12px;
  background:#fff;
  color:#5d6e8b;
  font-size:.84rem;
  border:1px solid #e4ebf5;
}
.settings-time-preview i{ color:#176df2; margin-top:.05rem; }

/* =========================================================
   Clientes — tabla de escritorio + tarjetas móviles (final)
   ========================================================= */
.client-table-scroll{
  width:100%;
  padding:10px 12px 12px;
  border:1px solid #e3e8ef;
  border-radius:20px;
  background:#f7f9fc;
  overflow-x:auto;
  overflow-y:visible;
}
.client-table-header,
.client-row-card{
  min-width:1320px;
  grid-template-columns:minmax(185px,1.25fr) 78px 142px 142px 92px 122px minmax(225px,1fr) 204px;
  column-gap:12px;
}
.client-table-header{
  display:grid;
  align-items:end;
  padding:12px 12px 13px;
  color:#0b1f3c;
  font-size:.79rem;
  font-weight:850;
  line-height:1.15;
}
.client-list{ gap:8px; }
.client-row-card{
  min-height:64px;
  padding:10px 12px;
  border:1px solid #e4e9f0;
  border-radius:15px;
  background:#fff;
  box-shadow:0 2px 8px rgba(21,48,78,.035);
  transform:none;
}
.client-row-card:hover{
  transform:none;
  border-color:#d7e1ed;
  box-shadow:0 5px 14px rgba(21,48,78,.055);
}
.client-row-card:has(.dropdown-menu.show){
  position:relative;
  z-index:1200;
}
.client-avatar{
  width:44px;
  height:44px;
  flex:0 0 44px;
  font-size:.84rem;
}
.client-identity{ gap:.72rem; }
.client-name{ font-size:.86rem; font-weight:850; }
.client-number{ font-size:.7rem; }
.client-data-cell{ gap:.1rem; }
.client-data-cell strong{ font-size:.82rem; }
.client-data-cell small{ font-size:.69rem; }
.client-data-label{ display:none; }
.client-date{ font-size:.74rem; gap:.38rem; }
.client-date i{ font-size:.78rem; }
.client-ip{ margin-top:0; gap:.35rem; font-size:.76rem; }
.client-ip i{ display:none; }
.client-ip a{ color:#066ce7; text-decoration:underline; text-underline-offset:2px; }
.client-days-wrap{ display:flex; flex-direction:row; align-items:center; justify-content:center; }
.client-days{
  width:38px;
  height:38px;
  font-size:.77rem;
  color:#fff;
}
.client-status{
  min-width:0;
  min-height:34px;
  padding:.45rem .7rem;
  border:0;
  border-radius:999px;
  font-size:.7rem;
  line-height:1;
  font-weight:900;
  box-shadow:0 3px 7px rgba(0,0,0,.05);
}
.client-status.status-paid{ background:var(--status-sky); color:#12334a; border:0; }
.client-status.status-pending{ background:var(--status-yellow); color:#493800; border:0; }
.client-status.status-late{ background:#ff4f43; color:#fff; border:0; }
.client-status.status-cancelled{ background:var(--status-black); color:#fff; border:0; }
.client-billing{
  min-height:31px;
  padding:.34rem .55rem;
  border-radius:8px;
  font-size:.67rem;
  gap:.34rem;
}
.client-actions{ gap:5px; flex-wrap:nowrap; }
.client-action-btn{
  width:36px;
  height:36px;
  flex:0 0 36px;
  border-radius:11px;
  font-size:.91rem;
}
.client-action-btn.action-edit{ background:#159bd3; }
.client-action-btn.action-pay{ background:#00ae68; }
.client-action-btn.action-history{ background:#a23bb1; }
.client-action-btn.action-print{ background:#23465f; }
.client-action-btn.action-delete{ background:#ff4b40; }
.client-mobile-more{ display:none; }
.client-actions-menu{
  min-width:220px;
  z-index:1300 !important;
  padding:.5rem;
  border:1px solid #e3e8ef;
  border-radius:14px;
  background:#fff !important;
  opacity:1 !important;
  box-shadow:0 18px 45px rgba(15,31,54,.22);
  overflow:hidden;
}
.client-actions-menu.show{ background:#fff !important; opacity:1 !important; }
.client-actions-menu .dropdown-item{ background:#fff; color:#243652; }
.client-actions-menu .dropdown-item:hover,
.client-actions-menu .dropdown-item:focus{ background:#f2f6fb; color:#17283f; }
.client-actions-menu .dropdown-item.text-danger{ color:#dc3545 !important; }

/* Mantener la tabla completa en escritorio/tablet; las tarjetas empiezan sólo en móvil. */
@media (min-width:768px){
  .client-package-cell,
  .client-billing-cell,
  .client-date-cell,
  .client-status-cell,
  .client-ip-cell{ display:flex !important; }
  .client-days-wrap{ display:flex !important; }
}

@media (max-width:767px){
  .client-table-scroll{
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    overflow:visible;
  }
  .client-table-header{ display:none; }
  .client-list{ gap:11px; }
  .client-row-card{
    min-width:0;
    min-height:0;
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-areas:
      "identity actions"
      "ip ip"
      "package days"
      "date date"
      "status billing";
    column-gap:12px;
    row-gap:10px;
    padding:14px 15px;
    border:1px solid #e8edf4;
    border-radius:18px;
    box-shadow:0 7px 22px rgba(26,52,88,.045);
    overflow:visible;
  }
  .client-row-card:has(.dropdown-menu.show){ z-index:1600; }
  .client-identity{ grid-area:identity; min-width:0; align-self:start; }
  .client-avatar{ width:48px; height:48px; flex-basis:48px; font-size:.88rem; }
  .client-name{ font-size:.91rem; }
  .client-number{ font-size:.72rem; }
  .client-data-label{
    display:block;
    margin-bottom:2px;
    color:#647696;
    font-size:.63rem;
    font-weight:850;
    line-height:1.1;
  }
  .client-package-cell{ grid-area:package; }
  .client-billing-cell{ grid-area:billing; justify-self:end; align-items:flex-end; }
  .client-date-cell{
    grid-area:date;
    display:flex !important;
    padding-top:11px;
    border-top:1px solid #edf1f6;
  }
  .client-days-wrap{
    grid-area:days;
    flex-direction:column;
    align-items:flex-end;
    justify-self:end;
    gap:4px;
  }
  .client-ip-cell{
    grid-area:ip;
    display:flex !important;
    margin-left:60px;
    margin-top:-13px;
  }
  .client-ip-cell .client-data-label{ display:none; }
  .client-ip{ font-size:.76rem; margin:0; }
  .client-ip i{ display:inline-block; color:#6e82a4; }
  .client-ip a{ font-weight:800; text-decoration:none; }
  .client-status-cell{ grid-area:status; display:flex !important; }
  .client-status{
    min-height:31px;
    padding:.4rem .66rem;
    font-size:.65rem;
  }
  .client-billing{ min-height:31px; font-size:.65rem; }
  .client-actions{
    grid-area:actions;
    align-self:start;
    justify-self:end;
    gap:6px;
    position:relative;
    z-index:2;
  }
  .client-action-btn{ width:38px; height:38px; flex-basis:38px; border-radius:11px; }
  .client-action-btn.action-pay{ display:inline-flex !important; }
  .client-desktop-action{ display:none !important; }
  .client-mobile-more{ display:block; position:relative; }
  .client-action-btn.action-more{ background:#fff; color:#536580; border:1px solid #d7e1ee; }
  .client-actions-menu{
    position:absolute !important;
    right:0 !important;
    left:auto !important;
    top:44px !important;
    transform:none !important;
    margin:0 !important;
    z-index:1700 !important;
    background:#fff !important;
  }
}

@media (max-width:480px){
  .clients-toolbar{ gap:.75rem; }
  .client-row-card{
    grid-template-areas:
      "identity actions"
      "ip ip"
      "package days"
      "date date"
      "status billing";
    padding:13px 14px;
    row-gap:9px;
  }
  .client-ip-cell{ margin-left:58px; }
  .client-status-cell{ justify-self:start; }
  .client-billing-cell{ justify-self:end; align-items:flex-end; }
}


/* Ajuste 2026-08-17: contador relativo junto a la fecha de pago. */
.client-date-relative{
  display:block;
  margin-top:1px;
  padding-left:1.16rem;
  color:#74839c !important;
  font-size:.63rem !important;
  line-height:1.18;
  white-space:nowrap;
}
@media (max-width:767px){
  .client-date-relative{
    padding-left:1.2rem;
    font-size:.66rem !important;
  }
}

/* Smart client analysis + business intelligence */
.manual-grace-disabled{ opacity:.55; }
.manual-grace-disabled input{ pointer-events:none; background:#eef2f7; }
.smart-client-card{
  display:flex;
  align-items:center;
  gap:1rem;
  padding:1rem 1.1rem;
  border:1px solid #dce7f7;
  border-radius:18px;
  background:linear-gradient(135deg,#f7fbff,#eef5ff);
}
.smart-client-score{
  width:78px;
  height:78px;
  flex:0 0 78px;
  display:flex;
  align-items:baseline;
  justify-content:center;
  border-radius:24px;
  background:#0d6efd;
  color:#fff;
  padding-top:22px;
  box-shadow:0 12px 28px rgba(13,110,253,.2);
}
.smart-client-score span{ font-size:1.65rem; line-height:1; font-weight:900; }
.smart-client-score small{ font-size:.7rem; opacity:.8; }
.smart-client-metrics{ display:flex; gap:.55rem; flex-wrap:wrap; margin-top:.65rem; }
.smart-client-metrics span{ padding:.38rem .55rem; border-radius:10px; background:#fff; border:1px solid #e1e9f4; font-size:.75rem; color:#596b87; }
.client-smart-mini{ margin-top:2px; color:#60779a; font-size:.62rem; font-weight:750; white-space:nowrap; }
.client-smart-mini i{ color:#6c55e7; }

.smart-dashboard-card{
  display:flex;
  align-items:center;
  gap:1rem;
  padding:1rem 1.15rem;
  border-radius:20px;
  text-decoration:none;
  background:linear-gradient(100deg,#171d33,#303a6e);
  color:#fff;
  box-shadow:0 14px 34px rgba(24,32,74,.18);
}
.smart-dashboard-card:hover{ color:#fff; transform:translateY(-1px); }
.smart-dashboard-icon{ width:50px; height:50px; display:flex; align-items:center; justify-content:center; flex:0 0 50px; border-radius:16px; background:rgba(255,255,255,.12); font-size:1.35rem; }
.smart-dashboard-main{ min-width:0; flex:1; display:flex; flex-direction:column; }
.smart-dashboard-main .small{ opacity:.72; }
.smart-dashboard-main strong{ font-size:1rem; }
.smart-dashboard-main span{ font-size:.76rem; opacity:.78; }
.smart-dashboard-stats{ display:flex; gap:.55rem; flex-wrap:wrap; justify-content:flex-end; }
.smart-dashboard-stats span{ padding:.45rem .62rem; border-radius:10px; background:rgba(255,255,255,.1); font-size:.72rem; }
.smart-dashboard-stats b{ font-size:.9rem; }
.smart-dashboard-arrow{ opacity:.65; }

.intel-page h2{ font-weight:850; letter-spacing:-.035em; color:#17243d; }
.intel-head{ display:flex; justify-content:space-between; align-items:center; gap:1rem; }
.intel-kicker{ display:inline-flex; align-items:center; gap:.4rem; color:#6b55dd; font-size:.78rem; font-weight:850; text-transform:uppercase; letter-spacing:.06em; }
.intel-range-actions{ display:flex; gap:.5rem; flex-wrap:wrap; }
.intel-range-actions .btn{ border-radius:12px; font-weight:750; }
.intel-period{ display:inline-flex; align-items:center; gap:.5rem; padding:.55rem .75rem; border-radius:12px; background:#fff; border:1px solid #e5eaf2; color:#66758d; font-size:.8rem; }
.intel-health-card{ background:linear-gradient(145deg,#11182c,#283766); color:#fff; overflow:hidden; }
.intel-health-card .text-muted{ color:rgba(255,255,255,.68)!important; }
.intel-health-card > .d-flex > i{ font-size:2rem; opacity:.78; }
.intel-health-label{ font-size:1.1rem; font-weight:850; }
.intel-health-score{ display:flex; align-items:baseline; gap:.2rem; margin-top:1.25rem; }
.intel-health-score span{ font-size:3rem; line-height:1; font-weight:900; }
.intel-health-score small{ opacity:.65; }
.intel-progress{ height:9px; margin-top:.7rem; background:rgba(255,255,255,.12); }
.intel-progress .progress-bar{ background:#fff; }
.intel-metric{ display:flex; flex-direction:column; justify-content:center; min-height:168px; }
.intel-metric > i{ font-size:1.45rem; color:#346cea; margin-bottom:.65rem; }
.intel-metric span{ color:#77859a; font-size:.75rem; font-weight:750; }
.intel-metric strong{ margin:.2rem 0; color:#19253c; font-size:1.15rem; }
.intel-metric small{ color:#8b98aa; font-size:.68rem; }
.intel-profit-note{ display:flex; gap:.7rem; align-items:flex-start; padding:.85rem 1rem; border:1px solid #f1d995; border-radius:14px; background:#fff9e8; color:#755d16; font-size:.78rem; }
.intel-profit-note i{ margin-top:.05rem; }
.intel-soft-pill{ padding:.42rem .58rem; border-radius:999px; background:#eef4ff; color:#3862ad; font-size:.7rem; font-weight:800; }
.intel-bars{ display:flex; flex-direction:column; gap:.8rem; }
.intel-bar-row{ display:grid; grid-template-columns:74px 1fr 90px; gap:.7rem; align-items:center; }
.intel-bar-label{ color:#687791; font-size:.72rem; font-weight:750; }
.intel-bar-track{ height:12px; border-radius:999px; background:#edf1f7; overflow:hidden; }
.intel-bar-fill{ height:100%; border-radius:999px; background:linear-gradient(90deg,#6d55de,#2f78ea); }
.intel-bar-value{ text-align:right; font-size:.75rem; font-weight:800; color:#25334b; }
.intel-client-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:.7rem; }
.intel-client-grid > div{ padding:.75rem; border-radius:14px; background:#f7f9fc; border:1px solid #edf0f5; display:flex; justify-content:space-between; align-items:center; gap:.5rem; }
.intel-client-grid span{ color:#73829a; font-size:.72rem; }
.intel-client-grid strong{ font-size:1rem; color:#1c2940; }
.intel-tolerance-list{ display:flex; flex-wrap:wrap; gap:.5rem; }
.intel-tolerance-list span{ padding:.42rem .58rem; border-radius:10px; background:#f2f5fa; font-size:.7rem; color:#66758d; }
.intel-tolerance-list b{ color:#25334b; }
.intel-insights{ display:flex; flex-direction:column; gap:.65rem; }
.intel-insight{ display:flex; gap:.7rem; align-items:flex-start; padding:.75rem .8rem; border-radius:13px; font-size:.77rem; line-height:1.4; }
.intel-insight i{ margin-top:.1rem; }
.intel-good{ background:#edf9f3; color:#256845; }
.intel-warn{ background:#fff7e5; color:#7a5b10; }
.intel-danger{ background:#fff0f0; color:#923737; }
.intel-info{ background:#eef5ff; color:#385d91; }
.intel-top-list{ display:flex; flex-direction:column; gap:.55rem; }
.intel-top-list > div{ display:flex; align-items:center; gap:.7rem; padding:.6rem .65rem; border-radius:12px; background:#f8fafc; }
.intel-top-list strong{ display:block; font-size:.78rem; color:#25334a; }
.intel-top-list small{ display:block; color:#8390a2; font-size:.66rem; }
.intel-top-list b{ font-size:.78rem; color:#22324c; }
.intel-rank{ width:26px; height:26px; display:inline-flex; align-items:center; justify-content:center; border-radius:9px; background:#eaf1ff; color:#3b68bc; font-size:.68rem; font-weight:900; }
.intel-score-pill{ display:inline-flex; padding:.35rem .5rem; border-radius:9px; background:#eef2ff; color:#5141ae; font-weight:850; font-size:.72rem; }
.intel-table th{ white-space:nowrap; }
.intel-table td{ font-size:.78rem; }

@media (max-width: 991px){
  .intel-head{ align-items:flex-start; flex-direction:column; }
  .smart-dashboard-card{ align-items:flex-start; flex-wrap:wrap; }
  .smart-dashboard-stats{ width:100%; justify-content:flex-start; padding-left:66px; }
  .smart-dashboard-arrow{ display:none; }
}
@media (max-width: 767px){
  .smart-client-card{ align-items:flex-start; }
  .smart-client-score{ width:64px; height:64px; flex-basis:64px; padding-top:18px; border-radius:19px; }
  .smart-client-score span{ font-size:1.35rem; }
  .client-smart-mini{ font-size:.6rem; }
  .intel-range-actions{ width:100%; }
  .intel-range-actions .btn{ flex:1; }
  .intel-bar-row{ grid-template-columns:62px 1fr 72px; }
  .intel-client-grid{ grid-template-columns:1fr; }
  .smart-dashboard-stats{ padding-left:0; }
}
.smart-history-summary{ display:grid; grid-template-columns:repeat(4,1fr); gap:.7rem; }
.smart-history-summary > div{ padding:.75rem .9rem; border:1px solid #e4eaf3; border-radius:14px; background:#fff; box-shadow:0 6px 18px rgba(27,52,86,.04); }
.smart-history-summary span{ display:block; color:#7c899c; font-size:.68rem; }
.smart-history-summary strong{ display:block; margin-top:.15rem; color:#1d2c44; font-size:.9rem; }
.payment-timing{ display:inline-flex; padding:.3rem .45rem; border-radius:8px; font-size:.68rem; font-weight:800; white-space:nowrap; }
.timing-good{ background:#eaf8f1; color:#22734b; }
.timing-warn{ background:#fff5d9; color:#806016; }
.timing-late{ background:#ffeded; color:#a33c3c; }
@media (max-width:767px){ .smart-history-summary{ grid-template-columns:repeat(2,1fr); } }

/* FASE 3: control independiente del estado del servicio */
.service-state-badge{
  display:inline-flex; align-items:center; gap:.32rem; width:max-content;
  padding:.28rem .48rem; margin-top:.3rem; border-radius:999px;
  font-size:.61rem; line-height:1; font-weight:850; letter-spacing:.02em;
  border:1px solid transparent; white-space:nowrap;
}
.service-state-badge.service-active{ background:#eaf8f1; color:#197a4b; border-color:#bfe9d2; }
.service-state-badge.service-paused{ background:#fff5d9; color:#8a6512; border-color:#f0d486; }
.service-state-badge.service-blocked{ background:#fff0ef; color:#b63838; border-color:#f3b1ad; }
.client-status-cell{ min-width:0; }
.client-status-cell .service-state-badge{ max-width:100%; white-space:nowrap; }
.client-credit-note{ display:block; margin-top:.22rem; color:#7b5a00 !important; font-size:.59rem !important; font-weight:800; line-height:1.2; white-space:nowrap; }
.client-row-card.client-paused{ border-color:#f0d486; background:linear-gradient(90deg,#fffdf7,#fff); }
.client-row-card.client-blocked-manual{ border-color:#efb6b2; background:linear-gradient(90deg,#fff9f8,#fff); }
.client-action-btn.action-service{ background:#64748b; }
.client-action-btn.action-service.service-is-paused{ background:#d89a16; }
.client-action-btn.action-service.service-is-blocked{ background:#d94b46; }
.client-service-actions{ position:relative; }
.service-control-card{ border:1px solid #e3eaf4; background:linear-gradient(135deg,#fbfdff,#f6f9fd); }
.service-events-list{ display:flex; flex-direction:column; gap:.45rem; }
.service-event-item{
  display:grid; grid-template-columns:110px 140px 80px 1fr; gap:.6rem; align-items:center;
  padding:.55rem .7rem; border:1px solid #e9edf3; border-radius:12px; background:#fff;
  color:#66758d; font-size:.7rem;
}
.service-event-item strong{ color:#24344f; }
.service-event-item small{ color:#7b8798; overflow-wrap:anywhere; }
@media (max-width:767px){
  .service-event-item{ grid-template-columns:1fr 1fr; }
  .service-event-item small{ grid-column:1/-1; }
  .client-service-actions .dropdown-menu{ z-index:1800; }
}

/* ===== Comprobantes / Veriko 5.4.9 ===== */
.container-proofs-wide{max-width:1500px;width:100%;}
.proofs-page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1rem;}
.payment-proofs-list{display:grid;gap:1rem;}
.proof-card{padding:1rem 1.1rem;overflow:hidden;}
.proof-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;margin-bottom:1rem;}
.proof-client{min-width:0;}
.proof-status-badge{flex:0 0 auto;}
.proof-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.75rem;}
.proof-summary-item{min-width:0;border:1px solid #e4e8ef;border-radius:12px;padding:.75rem .85rem;background:#fff;display:flex;flex-direction:column;gap:.2rem;}
.proof-summary-label{font-size:.78rem;color:#6b7280;}
.proof-summary-value{font-size:1rem;line-height:1.25;overflow-wrap:anywhere;}
.proof-summary-sub{font-size:.74rem;color:#6b7280;overflow-wrap:anywhere;}
.proof-meta-grid{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(0,.7fr) minmax(0,1fr) auto;gap:.75rem;align-items:stretch;margin-top:.75rem;}
.proof-meta-item{min-width:0;padding:.65rem .75rem;border-radius:10px;background:#f8fafc;border:1px solid #eef1f5;display:flex;flex-direction:column;gap:.15rem;}
.proof-meta-item span{font-size:.72rem;color:#6b7280;text-transform:uppercase;letter-spacing:.02em;}
.proof-meta-item strong{font-size:.84rem;overflow-wrap:anywhere;word-break:break-word;}
.proof-capture-btn{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;min-width:130px;}
.proof-details-row{display:flex;flex-wrap:wrap;gap:1rem;margin-top:.8rem;}
.proof-details-row details{min-width:210px;}
.proof-details-row summary,.proof-advanced summary{cursor:pointer;font-size:.86rem;font-weight:650;}
.proof-details-row pre{white-space:pre-wrap;overflow:auto;max-height:240px;max-width:100%;margin:.5rem 0 0;padding:.75rem;border-radius:10px;background:#f8fafc;border:1px solid #edf0f4;font-size:.77rem;}
.proof-review-panel{margin-top:1rem;padding-top:1rem;border-top:1px solid #e7eaf0;}
.proof-review-title{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;margin-bottom:.9rem;}
.proof-form-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:.8rem;align-items:start;}
.proof-field{min-width:0;}
.proof-field .form-label{font-size:.8rem;font-weight:600;margin-bottom:.35rem;}
.proof-field-amount{grid-column:span 2;}
.proof-field-date{grid-column:span 2;}
.proof-field-bank{grid-column:span 2;}
.proof-field-tracking{grid-column:span 6;}
.proof-field-reference{grid-column:span 3;}
.proof-field-note{grid-column:span 9;}
.proof-primary-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.75rem;margin-top:.9rem;}
.proof-primary-actions .btn,.proof-advanced-actions .btn{min-height:42px;display:flex;align-items:center;justify-content:center;}
.proof-advanced{margin-top:.85rem;padding:.7rem .8rem;border:1px solid #e7eaf0;border-radius:10px;background:#fbfcfe;}
.proof-advanced-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem;}

@media (max-width:1199.98px){
  .proof-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .proof-meta-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .proof-capture-btn{grid-column:span 2;}
  .proof-field-amount,.proof-field-date,.proof-field-bank{grid-column:span 4;}
  .proof-field-tracking{grid-column:span 8;}
  .proof-field-reference{grid-column:span 4;}
  .proof-field-note{grid-column:span 12;}
  .proof-primary-actions{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:767.98px){
  .proofs-page-header{flex-direction:column;}
  .proof-filter-group{width:100%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));}
  .proof-filter-group .btn{border-radius:0!important;}
  .proof-card{padding:.85rem;}
  .proof-summary-grid,.proof-meta-grid,.proof-form-grid,.proof-primary-actions,.proof-advanced-actions{grid-template-columns:1fr;}
  .proof-capture-btn,.proof-field-amount,.proof-field-date,.proof-field-bank,.proof-field-tracking,.proof-field-reference,.proof-field-note{grid-column:auto;}
  .proof-review-title{flex-direction:column;gap:.5rem;}
}

/* Cuentas multiservicio */
.client-group-mini{ margin-top:2px; color:#08765d; font-size:.62rem; font-weight:800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.client-group-mini i{ color:#0a9f79; }
.client-special-rate{ color:#08765d !important; font-weight:800; white-space:nowrap; }
.group-payment-card{ border:1px solid #d9e8ff; background:linear-gradient(180deg,#fbfdff,#fff); }
.group-service-row{ display:grid; grid-template-columns:minmax(150px,1.4fr) minmax(110px,.8fr) minmax(100px,.7fr) minmax(100px,.7fr); gap:10px; align-items:center; padding:.65rem .75rem; border:1px solid #e8eef7; border-radius:12px; background:#fff; }
.group-service-row + .group-service-row{ margin-top:.5rem; }
.group-total-box{ border-radius:14px; background:#eef7ff; padding:.9rem 1rem; }
@media (max-width:767.98px){
  .group-service-row{ grid-template-columns:1fr 1fr; }
}
