/* Portal Cliente Conekta - CSS */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f3f4f6;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --text-muted: #6b7280;
  --sidebar-bg: #1e293b;
  --sidebar-text: #e5e7eb;
  --sidebar-active: #0ea5e9;
}
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* === LOGIN === */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  padding: 20px;
}
.login-card {
  background: white; border-radius: 16px; padding: 40px; width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2); text-align: center;
}
.login-logo { width: 220px; max-width: 80%; margin-bottom: 8px; }
.login-subtitle { color: var(--text-muted); margin-bottom: 30px; font-size: 14px; }
.input-group {
  position: relative; margin-bottom: 16px; display: flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: 10px; padding: 0 14px; transition: border .2s;
}
.input-group:focus-within { border-color: var(--primary); }
.input-group .material-icons-round { color: var(--text-muted); font-size: 20px; }
.input-group input {
  flex: 1; padding: 14px 10px; border: none; outline: none; font-size: 15px; font-family: inherit; background: transparent;
}
.btn-login {
  width: 100%; padding: 14px; background: var(--primary); color: white; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s;
}
.btn-login:hover { background: var(--primary-dark); }
.error-text { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }
.login-help { margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.login-help a { color: var(--primary); text-decoration: none; font-weight: 600; }

/* === APP === */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; background: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column;
  position: fixed; height: 100vh; left: 0; top: 0;
}
.sidebar-header { padding: 24px 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.client-avatar {
  width: 72px; height: 72px; border-radius: 50%; background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; margin: 0 auto 12px;
}
.client-name { font-weight: 600; margin-bottom: 4px; }
.client-id { font-size: 12px; color: rgba(255,255,255,0.6); }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: var(--sidebar-text);
  text-decoration: none; cursor: pointer; transition: background .15s; font-size: 14px;
}
.nav-item:hover { background: rgba(255,255,255,0.05); }
.nav-item.active { background: var(--sidebar-active); color: white; }
.nav-item.logout { color: rgba(255,255,255,0.6); margin-top: 8px; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer { padding: 16px 20px; font-size: 11px; color: rgba(255,255,255,0.4); text-align: center; }

.main { flex: 1; margin-left: 260px; }
.topbar {
  background: white; padding: 14px 24px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.btn-icon { background: none; border: none; cursor: pointer; padding: 4px; color: var(--text-muted); display: none; }
.btn-icon .material-icons-round { font-size: 24px; }
.content { padding: 24px; }

/* === CARDS === */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.card {
  background: var(--card); border-radius: 12px; padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid var(--border);
}
.stat-card .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 8px; font-weight: 600; }
.stat-card .value { font-size: 28px; font-weight: 700; }
.stat-card .icon-box {
  width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: white; float: right;
}
.stat-card.deuda .icon-box { background: var(--primary); }
.stat-card.tickets .icon-box { background: #8b5cf6; }
.stat-card.consumo .icon-box { background: var(--warning); }
.stat-card.estado .icon-box { background: var(--success); }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* === TABLES === */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 10px 12px; background: #f9fafb; border-bottom: 2px solid var(--border); font-weight: 600; color: var(--text-muted);
  font-size: 12px; text-transform: uppercase;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.data-table tr:hover { background: #f9fafb; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .material-icons-round { font-size: 48px; color: var(--border); margin-bottom: 12px; }

.badge { display: inline-flex; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.badge.pagada, .badge.pagado { background: #d1fae5; color: #065f46; }
.badge.pendiente { background: #dbeafe; color: #1e40af; }
.badge.vencida, .badge.vencido, .badge.no_pagado { background: #fee2e2; color: #991b1b; }
.badge.cerrado { background: #f3f4f6; color: #4b5563; }
.badge.abierto { background: #fef3c7; color: #92400e; }

/* === BUTTONS === */
.btn { padding: 8px 16px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; transition: all .15s; font-family: inherit; }
.btn.primary { background: var(--primary); color: white; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.success { background: var(--success); color: white; }
.btn.danger { background: var(--danger); color: white; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--bg); }
.btn.sm { padding: 6px 12px; font-size: 13px; }

/* === FORMS === */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--text); }
.form-control { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; outline: none; transition: border .2s; }
.form-control:focus { border-color: var(--primary); }

/* === TOAST === */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 12px 18px; border-radius: 8px; color: white; font-size: 14px; min-width: 260px; display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slide-in .3s; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }
@keyframes slide-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === LOADING === */
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === MOBILE === */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; z-index: 100; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .btn-icon { display: block; }
  .content { padding: 16px; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
