/* =============================================
   TymForest POS - Ligas de Pago
   Estilos principales
============================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f6fa;
  color: #333;
  display: flex;
  min-height: 100vh;
}

a { color: #16a34a; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Login Page ---- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #14532d 0%, #16a34a 100%);
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.login-box {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h1 {
  font-size: 28px;
  color: #14532d;
}

.login-header p {
  color: #666;
  margin-top: 4px;
}

.login-info {
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  text-align: center;
}

.login-info p {
  margin: 0;
  color: #666;
  font-size: 14px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:hover { text-decoration: none; opacity: 0.9; }

.btn-primary {
  background: #16a34a;
  color: #fff;
}
.btn-primary:hover { background: #15803d; }

.btn-secondary {
  background: #e5e7eb;
  color: #374151;
}

.btn-microsoft {
  background: #fff;
  color: #333;
  border: 2px solid #e0e0e0;
  font-size: 16px;
  padding: 14px 20px;
}
.btn-microsoft:hover { background: #f8f8f8; border-color: #ccc; }

.btn-whatsapp {
  background: #25d366;
  color: #fff;
}
.btn-whatsapp:hover { background: #1da851; }

.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-logout {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #166534;
  width: 100%;
  margin-top: 8px;
}
.btn-logout:hover { color: #fff; border-color: #94a3b8; }

.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ---- Sidebar ---- */
.sidebar {
  width: 260px;
  background: #14532d;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid #166534;
}

.sidebar-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.sidebar-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 2px;
}

.sidebar-menu {
  list-style: none;
  padding: 12px 0;
  flex: 1;
}

.sidebar-menu li a {
  display: block;
  padding: 12px 20px;
  color: #cbd5e1;
  transition: all 0.2s;
}

.sidebar-menu li a:hover {
  background: #166534;
  color: #fff;
  text-decoration: none;
}

.sidebar-menu li.active a {
  background: #16a34a;
  color: #fff;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #166534;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-info strong {
  font-size: 14px;
}

.user-info span {
  font-size: 12px;
  color: #94a3b8;
  text-transform: capitalize;
}

/* ---- Main Content ---- */
.main-content {
  margin-left: 260px;
  padding: 24px 32px;
  flex: 1;
  min-height: 100vh;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.content-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #14532d;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ---- Stats Grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-card-warning {
  border-left: 4px solid #f59e0b;
}

.stat-label {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #14532d;
  margin-top: 4px;
}

.stat-sub {
  font-size: 14px;
  color: #64748b;
  margin-top: 2px;
}

/* ---- Cards ---- */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #14532d;
}

.card-body {
  padding: 20px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* ---- Tables ---- */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #f1f5f9;
}

.table td {
  padding: 12px;
  font-size: 14px;
  border-bottom: 1px solid #f8fafc;
  vertical-align: middle;
}

.table tr:hover td {
  background: #f8fafc;
}

.text-center { text-align: center; }
.text-muted { color: #94a3b8; }

/* ---- Status Badges ---- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-pendiente {
  background: #fef3c7;
  color: #92400e;
}

.badge-pagada {
  background: #d1fae5;
  color: #065f46;
}

.badge-cancelada {
  background: #fee2e2;
  color: #991b1b;
}

.badge-expirada {
  background: #e5e7eb;
  color: #374151;
}

.badge-paid {
  background: #d1fae5;
  color: #065f46;
}

.badge-refunded {
  background: #dbeafe;
  color: #1e40af;
}

.badge-reembolsada {
  background: #dbeafe;
  color: #1e40af;
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-control {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.form-control-sm {
  padding: 6px 10px;
  font-size: 13px;
}

/* ---- Pay Link Box ---- */
.pay-link-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
}

.pay-link-box label {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.pay-link-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.pay-link-row input {
  flex: 1;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}

/* ---- Alerts ---- */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ---- Filters ---- */
.filters-bar {
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
}

.filters-inline {
  display: flex;
  gap: 8px;
}

/* ---- Notifications ---- */
.notifications-bell {
  position: relative;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.notifications-bell:hover {
  background: #f1f5f9;
}

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  z-index: 200;
  display: flex;
  flex-direction: column;
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.notif-panel-header h3 {
  font-size: 16px;
}

.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.notif-item {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.notif-item:hover {
  background: #f8fafc;
}

.notif-item.unread {
  background: #f0fdf4;
  border-left: 3px solid #16a34a;
}

.notif-item .notif-title {
  font-weight: 600;
  font-size: 14px;
  color: #14532d;
}

.notif-item .notif-msg {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

.notif-item .notif-time {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.modal-header h3 {
  font-size: 18px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #94a3b8;
}

.modal-body {
  padding: 20px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f8fafc;
}

.detail-label {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.detail-value {
  font-size: 14px;
  color: #14532d;
  font-weight: 500;
}

/* ---- Pagination ---- */
.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 16px;
}

.pagination button {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.pagination button.active {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}

.link {
  font-size: 13px;
  color: #16a34a;
}

/* ---- Toggle Switch ---- */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #d1d5db;
  border-radius: 26px;
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: #f59e0b;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-header {
    width: 100%;
    padding: 16px;
  }

  .sidebar-menu {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    width: 100%;
  }

  .sidebar-menu li a {
    padding: 10px 16px;
    font-size: 13px;
  }

  .sidebar-footer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
  }

  .main-content {
    margin-left: 0;
    padding: 16px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
