/* =========================================================
   JOLT SOLUTIONS — clientes.css
   Área privada de clientes — hereda variables de style.css
   ========================================================= */

/* Tema oscuro específico del portal */
body.portal {
  background: var(--color-bg-deep);
  color: rgba(255, 255, 255, 0.88);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.portal::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 80% -10%, rgba(0, 212, 168, 0.12), transparent 55%),
    radial-gradient(ellipse at 10% 100%, rgba(31, 118, 210, 0.10), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

body.portal > * { position: relative; z-index: 1; }

/* ---------- HEADER del portal ---------- */
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(10, 22, 40, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 1rem;
  flex-wrap: wrap;
}

.portal-header .logo img {
  height: 36px;
  width: auto;
}

.portal-header-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.client-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: rgba(0, 212, 168, 0.12);
  border: 1px solid rgba(0, 212, 168, 0.35);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: #ffffff;
}

.client-badge::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--color-accent-bright);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 212, 168, 0.8);
}

.client-badge-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  margin-right: 0.25rem;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-logout:hover {
  background: rgba(229, 58, 74, 0.15);
  border-color: var(--color-danger);
  color: #ffffff;
}

.btn-logout svg { width: 14px; height: 14px; }

.back-to-site {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
}

.back-to-site:hover {
  color: var(--color-accent-bright);
  background: rgba(255, 255, 255, 0.05);
}

/* ---------- LOGIN ---------- */
.login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.login-card .brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-card .brand img {
  height: 52px;
  margin: 0 auto 1rem;
}

.login-card h1 {
  color: #ffffff;
  font-size: 1.6rem;
  margin-bottom: 0.35rem;
  text-align: center;
  font-family: var(--font-display);
}

.login-card .login-subtitle {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.login-card .form-group {
  margin-bottom: 1.25rem;
}

.login-card .form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 0.4rem;
}

.login-card .form-control {
  width: 100%;
  padding: 0.9rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
}

.login-card .form-control::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.login-card .form-control:focus {
  outline: none;
  border-color: var(--color-accent-bright);
  box-shadow: 0 0 0 3px rgba(0, 212, 168, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.login-card .btn-submit {
  width: 100%;
  padding: 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: #0a1628;
  background: var(--color-accent-bright);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 0.5rem;
  transition: all var(--t);
}

.login-card .btn-submit:hover {
  background: #00f0bf;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 212, 168, 0.35);
}

.login-error {
  display: none;
  background: rgba(229, 58, 74, 0.15);
  border: 1px solid var(--color-danger);
  color: #ff8a94;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.login-error.show { display: block; }

.login-demo-note {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(31, 118, 210, 0.08);
  border: 1px dashed rgba(31, 118, 210, 0.4);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.login-demo-note strong {
  color: var(--color-accent-bright);
  display: block;
  margin-bottom: 0.25rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.login-demo-note code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 3px;
  color: #ffffff;
  font-size: 0.82rem;
}

/* ---------- DASHBOARD ---------- */
.dashboard-wrap {
  flex: 1;
  padding: 2rem 1.5rem 4rem;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.dashboard-title {
  color: #ffffff;
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
  font-size: 1.6rem;
}

.dashboard-subtitle {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.92rem;
  margin-bottom: 2rem;
}

/* --- Pestañas --- */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab {
  padding: 0.8rem 1.2rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--t-fast);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.tab:hover {
  color: #ffffff;
}

.tab.active {
  color: var(--color-accent-bright);
  border-bottom-color: var(--color-accent-bright);
}

.tab .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  border-radius: 11px;
  font-size: 0.72rem;
  font-weight: 700;
}

.tab.active .count {
  background: rgba(0, 212, 168, 0.25);
  color: var(--color-accent-bright);
}

/* --- Filtros --- */
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-group label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
}

.filter-group input {
  padding: 0.6rem 0.8rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
}

.filter-group input::placeholder { color: rgba(255, 255, 255, 0.3); }

.filter-group input:focus {
  outline: none;
  border-color: var(--color-accent-bright);
  box-shadow: 0 0 0 2px rgba(0, 212, 168, 0.18);
}

.filter-group input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.6;
  cursor: pointer;
}

.filter-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  margin-bottom: 1rem;
}

.filter-clear:hover {
  color: var(--color-accent-bright);
  border-color: var(--color-accent-bright);
}

/* --- Tabla --- */
.table-wrap {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

table.docs {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

table.docs thead th {
  padding: 0.9rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

table.docs tbody td {
  padding: 1rem;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

table.docs tbody tr:last-child td { border-bottom: none; }

table.docs tbody tr {
  transition: background var(--t-fast);
}

table.docs tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.doc-number {
  font-family: var(--font-display);
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.doc-date {
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
}

/* Estado */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-ok {
  background: rgba(0, 212, 168, 0.12);
  color: #4ff0c8;
  border: 1px solid rgba(0, 212, 168, 0.3);
}

.status-ok::before { background: #4ff0c8; box-shadow: 0 0 6px #4ff0c8; }

.status-ko {
  background: rgba(229, 58, 74, 0.14);
  color: #ff8a94;
  border: 1px solid rgba(229, 58, 74, 0.35);
}

.status-ko::before { background: #ff8a94; }

/* Botón descargar */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-accent-bright);
  background: rgba(0, 212, 168, 0.1);
  border: 1px solid rgba(0, 212, 168, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-download:hover {
  background: rgba(0, 212, 168, 0.2);
  transform: translateY(-1px);
}

.btn-download svg { width: 14px; height: 14px; }

/* Estado vacío */
.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.95rem;
}

.empty-state .emoji {
  display: block;
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 720px) {
  .portal-header {
    padding: 0.85rem 1rem;
  }
  .portal-header .logo img { height: 30px; }
  .client-badge-label { display: none; }
  .dashboard-wrap { padding: 1.5rem 1rem 3rem; }
  .login-card { padding: 2rem 1.5rem; }
  .login-card h1 { font-size: 1.4rem; }
  .tab { padding: 0.7rem 0.9rem; font-size: 0.88rem; }
  .btn-logout span { display: none; }
  .filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 460px) {
  .filters { grid-template-columns: 1fr; }
  .back-to-site span { display: none; }
}
