/* =====================================================
   STRIPE PAYMENT SYSTEM - Global Styles
   ===================================================== */
:root {
  --primary:    #635bff;
  --primary-dk: #4f46e5;
  --success:    #22c55e;
  --danger:     #ef4444;
  --warning:    #f59e0b;
  --dark:       #0f172a;
  --gray:       #64748b;
  --light:      #f8fafc;
  --border:     #e2e8f0;
  --white:      #ffffff;
  --shadow:     0 4px 24px rgba(99,91,255,.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--light);
  color: var(--dark);
  min-height: 100vh;
}
/* Topbar */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.topbar img.logo { height: 54px; object-fit: contain; }
.topbar .empresa-nombre { font-size: 1.25rem; font-weight: 700; color: var(--dark); letter-spacing: -.02em; }
/* Cards */
.card { background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); }
/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 10px; font-size: .95rem;
  font-weight: 600; border: none; cursor: pointer;
  text-decoration: none; transition: all .2s;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dk); transform: translateY(-1px); }
.btn-success { background: var(--success); color: var(--white); }
.btn-danger  { background: var(--danger);  color: var(--white); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-sm { padding: 7px 14px; font-size: .82rem; }
.btn-full { width: 100%; justify-content: center; }
/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: .83rem; font-weight: 600; color: var(--gray); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.form-control { width: 100%; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 1rem; color: var(--dark); background: var(--white); transition: border-color .2s, box-shadow .2s; outline: none; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,91,255,.15); }
/* Badges */
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: .78rem; font-weight: 600; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef9c3; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-info    { background: #dbeafe; color: #1d4ed8; }
/* Tables */
.table-wrapper { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead th { background: var(--light); padding: 12px 16px; text-align: left; font-size: .8rem; font-weight: 700; color: var(--gray); text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid var(--border); }
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: .92rem; }
tbody tr:hover { background: #f8f9ff; }
tbody tr:last-child td { border-bottom: none; }
/* Alerts */
.alert { padding: 14px 20px; border-radius: 10px; font-size: .92rem; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
/* Admin layout */
.admin-layout { display: flex; min-height: calc(100vh - 73px); }
.sidebar { width: 260px; background: var(--dark); padding: 24px 0; flex-shrink: 0; }
.sidebar-menu { list-style: none; }
.sidebar-menu li a { display: flex; align-items: center; gap: 12px; padding: 13px 24px; color: #94a3b8; text-decoration: none; font-size: .92rem; font-weight: 500; transition: all .2s; border-left: 3px solid transparent; }
.sidebar-menu li a:hover, .sidebar-menu li a.active { color: var(--white); background: rgba(255,255,255,.06); border-left-color: var(--primary); }
.sidebar-menu li a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-section { font-size: .72rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .08em; padding: 20px 24px 6px; }
.admin-content { flex: 1; padding: 32px; overflow-y: auto; }
/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 24px; display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.stat-icon.purple { background: #ede9fe; }
.stat-icon.green  { background: #dcfce7; }
.stat-icon.blue   { background: #dbeafe; }
.stat-icon.orange { background: #ffedd5; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--dark); }
.stat-label { font-size: .82rem; color: var(--gray); margin-top: 2px; }
/* Payment page */
.pay-container { max-width: 520px; margin: 40px auto; padding: 0 20px 60px; }
.amount-wrapper { position: relative; }
.amount-prefix { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 1.2rem; font-weight: 700; color: var(--gray); }
.amount-wrapper .form-control { padding-left: 36px; font-size: 1.4rem; font-weight: 700; }
.secure-badge { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: .8rem; color: var(--gray); margin-top: 20px; }
.page-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; color: var(--dark); }
.page-subtitle { color: var(--gray); font-size: .95rem; margin-bottom: 28px; }
/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: 16px; padding: 32px; width: 100%; max-width: 480px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-title { font-size: 1.2rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--gray); }
/* Misc */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.link-box { background: var(--light); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: .85rem; word-break: break-all; color: var(--primary); }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
/* Responsive */
@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .admin-content { padding: 20px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
}
