:root {
  --yape-purple: #742384;
  --yape-mint: #10cbb4;
  --yape-gray: #544a69;
  --bg-color: #f4f6f8;
  --white: #ffffff;
  --text-color: #333;
  --error-color: #e74c3c;
  --success-color: #2ecc71;
  --border-radius: 12px;
}

body {
  font-family: "Outfit", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  line-height: 1.5;
}

/* --- Layouts --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

/* Centered Layout (Login, Status) */
.layout-centered {
  min-height: calc(100vh - 60px);
  margin-top: 60px;
  display: flex !important;
  flex-direction: column;
}

.layout-centered .content-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  width: 100%;
}

/* Regular Layout (Product, Admin) */
.layout-regular {
  margin-top: 60px;
  display: flex !important;
  flex-direction: column;
}

.layout-regular .content-wrapper {
  flex-grow: 1;
  width: 100%;
  padding-bottom: 20px;
}

/* --- Card Styles --- */
.card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  box-sizing: border-box;
}

.max-w-sm { max-width: 400px; width: 100%; }
.max-w-md { max-width: 600px; width: 100%; }
.max-w-lg { max-width: 900px; width: 100%; }
.max-w-xl { max-width: 1200px; width: 100%; }

/* --- Product Page Grid --- */
.product-grid {
  display: flex;
  flex-direction: column;
}

/* Desktop: Side by Side */
@media (min-width: 768px) {
  .product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1000px; /* Limit width */
    margin: 40px auto;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08); /* Enhanced shadow */
  }
  
  .product-hero {
    border-radius: 20px 0 0 20px; /* Left rounding only */
    padding: 60px !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .product-content {
    padding: 50px !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* --- Form Grid --- */
@media (min-width: 768px) {
  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .form-group {
    margin-bottom: 0;
  }
}

/* --- Typography & Elements --- */
h1 { color: var(--yape-purple); margin-top: 0; }
.btn {
  display: inline-block;
  padding: 14px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-align: center;
  transition: all 0.2s;
}
.btn-block { width: 100%; box-sizing: border-box; }
.btn-primary { 
  background-color: var(--yape-mint); 
  color: var(--yape-purple); 
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

/* Inputs */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; font-size: 0.9rem; color: var(--yape-gray); }
.input-wrapper input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
  font-family: inherit;
}
.input-wrapper input:focus, select:focus {
  border-color: var(--yape-purple);
  outline: none;
  box-shadow: 0 0 0 3px rgba(116, 35, 132, 0.1);
}

/* Status Badges */
.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}
.status-PENDING { background: #fff3cd; color: #856404; }
.status-AUTHORIZED { background: #d4edda; color: #155724; }
.status-PAID { background: #c6f6d5; color: #22543d; }
.status-FAILED, .status-DENIED, .status-CANCELLED, .status-REJECTED { background: #f8d7da; color: #721c24; }
.status-EXPIRED { background: #e2e8f0; color: #4a5568; }
.status-UNKNOWN { background: #f7fafc; color: #a0aec0; }

/* Table Responsive */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th { text-align: left; padding: 12px; border-bottom: 2px solid #eee; color: var(--yape-gray); }
td { padding: 12px; border-bottom: 1px solid #f5f5f5; }

/* Admin Layout */
.layout-admin {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}
.layout-admin .card {
  padding: 30px;
}

/* --- DASHBOARD STYLES (Moved from dashboard.css for reliability) --- */

/* Filter Bar */
.filter-bar {
  display: flex;
  margin-bottom: 25px;
  gap: 15px;
  align-items: center;
}

.filter-form {
  display: flex;
  width: 100%;
  gap: 15px;
  flex-wrap: wrap;
}

.search-input {
  position: relative;
  flex-grow: 1;
  max-width: 400px;
}

.search-input svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #a0aec0;
  width: 18px;
  height: 18px;
}

.search-input input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 1px solid var(--border-color); /* Assumes var exists, redefine if needed */
  border-radius: 8px; /* Fallback for --radius-md */
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s;
}

.search-input input:focus {
  outline: none;
  border-color: var(--yape-purple);
  box-shadow: 0 0 0 3px rgba(116, 35, 132, 0.1);
}

.filter-select {
  padding: 12px 36px 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background-color: white;
  color: var(--text-color);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%232d3748%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 12px top 50%;
  background-size: 10px auto;
}

.btn-filter, .btn-clear {
  padding: 0 16px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-filter {
  background: var(--text-color);
  color: white;
}

.btn-filter:hover {
  background: black;
}

.btn-clear {
  background: #f1f1f1;
  color: #666;
  width: 44px;
  padding: 0;
}

/* Layout Dashboard */
.layout-dashboard {
  background-color: #f5f7fa;
  min-height: calc(100vh - 60px);
  margin-top: 60px;
  width: 100%;
  display: flex !important;
  flex-direction: column;
}

.layout-dashboard .content-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  flex-grow: 1;
}



.dashboard-container {
  padding: 30px 20px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%; /* Ensure width is explicit */
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
  width: 100%; /* Ensure full width */
}

.stat-card {
  background: white;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Icon colors */
.bg-purple { background: #f3e5f5; color: #742384; }
.bg-green { background: #c6f6d5; color: #22543d; }
.bg-red { background: #ffebee; color: #c53030; }

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #2d3748;
  margin: 0;
  line-height: 1;
}

.stat-label {
  color: #718096;
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 4px;
}

/* Dashboard Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.dashboard-title h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2d3748;
  margin: 0;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 15px;
  background: white;
  padding: 8px 16px;
  border-radius: 50px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: #f3e5f5;
  color: #742384;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.btn-logout {
  color: #718096;
  text-decoration: none; 
}

/* Table Enhancements */
.content-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid #edf2f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  margin: 0;
  color: #2d3748;
}

.btn-action {
  background: linear-gradient(135deg, var(--yape-mint) 0%, #0ea895 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Ensure Sort Links behave */
.sort-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Pagination */
.pagination {
  border-top: 1px solid #edf2f7;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fcfcfc;
}

.pagination-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-page {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
}

.btn-page:hover {
  border-color: var(--yape-purple);
  color: var(--yape-purple);
}

.btn-page.disabled {
  opacity: 0.5;
  pointer-events: none;
}
