/* ===================================================
   MotorHeritage — Área Clientes Styles
   =================================================== */

/* ============================================
   Login Section
   ============================================ */

.login-section {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 4rem;
  flex-direction: column;
  gap: 1.5rem;
}

.login-card {
  max-width: 480px;
  width: 100%;
  padding: 2.5rem;
  margin: 0 auto;
}

.login-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.login-card .subtitle {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-text);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.input-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-password-wrap input {
  width: 100%;
  padding-right: 3rem !important;
}

.btn-toggle-password {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.btn-toggle-password:hover {
  color: var(--color-text);
}

.login-separator {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1.5rem 0;
}

.login-note {
  font-size: 0.8rem;
  color: var(--color-text-subtle);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.forgot-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--color-primary-light);
  text-decoration: none;
  margin-bottom: 1rem;
  transition: color 0.2s;
}

.forgot-link:hover {
  color: var(--color-text);
}

.login-secure-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text-subtle);
  margin-top: 1rem;
}

.forgot-form h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.forgot-form p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

/* ============================================
   Dashboard Section
   ============================================ */

.dashboard-section {
  padding-top: calc(70px + 2rem);
  padding-bottom: 4rem;
  min-height: 100vh;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  align-items: start;
}

/* ============================================
   Sidebar
   ============================================ */

.dashboard-sidebar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 1.5rem;
  position: sticky;
  top: calc(70px + 1rem);
}

.dashboard-welcome {
  text-align: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.client-avatar {
  width: 56px;
  height: 56px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 0.75rem;
}

.client-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.client-role {
  font-size: 0.75rem;
  color: var(--color-text-subtle);
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tab-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-family: var(--font-body);
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  text-align: left;
  transition: background 0.2s, color 0.2s;
}

.tab-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.tab-btn.active {
  background: rgba(31, 111, 94, 0.15);
  color: var(--color-primary-light);
  font-weight: 600;
}

.sidebar-logout {
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}

.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: 1px solid var(--color-border);
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-family: var(--font-body);
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* ============================================
   Dashboard Panels
   ============================================ */

.dashboard-main {
  min-width: 0;
}

.dashboard-panel {
  display: none;
}

.dashboard-panel.active {
  display: block;
}

.panel-header {
  margin-bottom: 1.5rem;
}

.panel-header h2 {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}

.panel-header p {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* ============================================
   Stats Grid
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary-light);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ============================================
   Data Tables
   ============================================ */

.data-table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

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

.data-table tr:hover td {
  background: var(--color-surface-hover);
}

.expediente-id {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* ============================================
   Badges
   ============================================ */

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-finalizado {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-pendiente {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-pagada {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-cancelada {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ============================================
   Download Button
   ============================================ */

.btn-download {
  background: transparent;
  border: 1px solid var(--color-primary);
  color: var(--color-primary-light);
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.btn-download:hover {
  background: var(--color-primary);
  color: white;
}

/* ============================================
   Document List
   ============================================ */

.doc-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--color-border);
  gap: 1rem;
}

.doc-item:last-child {
  border-bottom: none;
}

.doc-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-text-muted);
  min-width: 0;
}

.doc-info svg {
  flex-shrink: 0;
  color: var(--color-primary-light);
}

.doc-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-meta {
  font-size: 0.75rem;
  color: var(--color-text-subtle);
}

/* ============================================
   Dashboard Forms
   ============================================ */

.dashboard-form-section {
  padding: 1.5rem;
}

.dashboard-form-section h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.section-note {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.datos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* Readonly input styling */
input[readonly] {
  background: rgba(255, 255, 255, 0.02);
  cursor: default;
  color: var(--color-text-muted);
}

/* ============================================
   Form status variants (dashboard)
   ============================================ */

.form-status {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* ============================================
   Responsive — Tablet
   ============================================ */

@media (max-width: 900px) {
  .dashboard-layout {
    grid-template-columns: 200px 1fr;
    gap: 1.25rem;
  }
}

@media (max-width: 768px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: static;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .tab-btn {
    flex: 0 1 auto;
    padding: 0.5rem 0.65rem;
    font-size: 0.8rem;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .datos-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 1.75rem 1.25rem;
  }

  .dashboard-section {
    padding-top: calc(70px + 1rem);
  }

  .data-table th,
  .data-table td {
    padding: 0.65rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
  }

  .stat-number {
    font-size: 1.75rem;
    margin-bottom: 0;
  }
}

/* ============================================
   Password / Login input — solid dark background
   Fixes transparent background on password dots
   and browser autofill blue/yellow override
   ============================================ */

.login-card input[type="email"] {
  background: #1a1a1a !important;
  background-color: #1a1a1a !important;
  color: var(--color-text) !important;
  -webkit-text-fill-color: var(--color-text) !important;
}

.login-card input[type="password"] {
  background: #1a1a1a !important;
  background-color: #1a1a1a !important;
  color: var(--color-text) !important;
  -webkit-text-fill-color: var(--color-text) !important;
}

.login-card input[type="text"] {
  background: #1a1a1a !important;
  background-color: #1a1a1a !important;
  color: var(--color-text) !important;
  -webkit-text-fill-color: var(--color-text) !important;
}

/* Fix browser autofill background (Chrome/Edge/Safari) */
.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover,
.login-card input:-webkit-autofill:focus,
.login-card input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #1a1a1a inset !important;
  -webkit-text-fill-color: var(--color-text) !important;
  caret-color: var(--color-text) !important;
}

/* ============================================
   Additional Rules for Password Input Fix
   ============================================ */

.login-card input[type="password"] {
  border: 1px solid var(--color-border);
  border-radius: 5px;
  padding: 0.5rem;
  font-size: 1rem;
  color: var(--color-text);
  transition: border-color 0.2s;
}

.login-card input[type="password"]:focus {
  border-color: var(--color-primary);
  outline: none;
}