/* Base styles shared across all panels */
.gr-app {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  box-sizing: border-box;
  line-height: 1.6;
  color: #1a1a2e;
}

.gr-app *, .gr-app *::before, .gr-app *::after {
  box-sizing: inherit;
}

/* Theme variables - User (Purple/Blue gradient) */
.gr-theme-user {
  --gr-primary: #7c3aed;
  --gr-primary-dark: #5b21b6;
  --gr-secondary: #06b6d4;
  --gr-accent: #f472b6;
  --gr-success: #10b981;
  --gr-danger: #ef4444;
  --gr-warning: #f59e0b;
  --gr-bg: linear-gradient(135deg, #f5f3ff 0%, #ecfeff 50%, #fdf2f8 100%);
  --gr-card-bg: rgba(255,255,255,0.85);
  --gr-header-bg: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
  --gr-shadow: 0 10px 40px rgba(124, 58, 237, 0.15);
}

/* Theme - Club Owner (Orange/Teal) */
.gr-theme-owner {
  --gr-primary: #f97316;
  --gr-primary-dark: #ea580c;
  --gr-secondary: #14b8a6;
  --gr-accent: #fbbf24;
  --gr-success: #22c55e;
  --gr-danger: #ef4444;
  --gr-warning: #f59e0b;
  --gr-bg: linear-gradient(135deg, #fff7ed 0%, #f0fdfa 50%, #fefce8 100%);
  --gr-card-bg: rgba(255,255,255,0.9);
  --gr-header-bg: linear-gradient(135deg, #f97316 0%, #14b8a6 100%);
  --gr-shadow: 0 10px 40px rgba(249, 115, 22, 0.15);
}

/* Theme - Admin (Indigo/Emerald) */
.gr-theme-admin {
  --gr-primary: #6366f1;
  --gr-primary-dark: #4f46e5;
  --gr-secondary: #10b981;
  --gr-accent: #ec4899;
  --gr-success: #22c55e;
  --gr-danger: #ef4444;
  --gr-warning: #f59e0b;
  --gr-bg: linear-gradient(135deg, #eef2ff 0%, #ecfdf5 50%, #fdf2f8 100%);
  --gr-card-bg: rgba(255,255,255,0.9);
  --gr-header-bg: linear-gradient(135deg, #6366f1 0%, #10b981 100%);
  --gr-shadow: 0 10px 40px rgba(99, 102, 241, 0.15);
}

.gr-app {
  background: var(--gr-bg, #f8fafc);
  min-height: 400px;
  padding: 2rem 1rem;
  border-radius: 24px;
}

/* Buttons */
.gr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.gr-btn-primary {
  background: linear-gradient(135deg, var(--gr-primary), var(--gr-secondary));
  color: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.gr-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  color: #fff;
}

.gr-btn-success {
  background: linear-gradient(135deg, var(--gr-success), #059669);
  color: #fff;
}

.gr-btn-danger {
  background: linear-gradient(135deg, var(--gr-danger), #dc2626);
  color: #fff;
}

.gr-btn-ghost {
  background: transparent;
  color: var(--gr-primary);
  border: 2px solid var(--gr-primary);
}

.gr-btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; border-radius: 8px; }
.gr-btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }
.gr-btn-block { width: 100%; }

/* Badges */
.gr-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.gr-badge-success { background: #d1fae5; color: #065f46; }
.gr-badge-danger { background: #fee2e2; color: #991b1b; }
.gr-badge-warning { background: #fef3c7; color: #92400e; }
.gr-badge-neutral { background: #f1f5f9; color: #475569; }

/* Alerts */
.gr-alert {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}
.gr-alert-info { background: #dbeafe; color: #1e40af; }
.gr-alert-warning { background: #fef3c7; color: #92400e; }
.gr-alert-danger { background: #fee2e2; color: #991b1b; }

/* Form elements */
.gr-input, .gr-form-group textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}
.gr-input:focus, .gr-form-group textarea:focus {
  outline: none;
  border-color: var(--gr-primary);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.gr-form-group {
  margin-bottom: 1.25rem;
}
.gr-form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #334155;
}
.gr-required { color: var(--gr-danger); }

.gr-card {
  background: var(--gr-card-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: var(--gr-shadow);
  border: 1px solid rgba(255,255,255,0.6);
  margin-bottom: 1.5rem;
}

.gr-text-muted { color: #94a3b8; font-size: 0.9rem; }
.gr-code {
  background: #f1f5f9;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--gr-primary-dark);
}

/* Dashboard shared */
.gr-dashboard { max-width: 1100px; margin: 0 auto; }

.gr-dashboard-header {
  position: relative;
  margin-bottom: 2rem;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--gr-shadow);
}

.gr-dashboard-header__bg {
  position: absolute;
  inset: 0;
  background: var(--gr-header-bg);
  opacity: 1;
}

.gr-dashboard-header__content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem;
  color: #fff;
}

.gr-dashboard-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
  font-weight: 800;
}

.gr-dashboard-header p {
  margin: 0;
  opacity: 0.9;
}

.gr-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  border: 3px solid rgba(255,255,255,0.5);
  flex-shrink: 0;
}

.gr-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.gr-dashboard-grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.gr-stat-card {
  background: var(--gr-card-bg);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--gr-shadow);
  border: 1px solid rgba(255,255,255,0.7);
  transition: transform 0.25s;
}
.gr-stat-card:hover { transform: translateY(-4px); }

.gr-stat-card__icon {
  font-size: 2rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  flex-shrink: 0;
}

.gr-stat-card--purple .gr-stat-card__icon { background: linear-gradient(135deg, #ede9fe, #ddd6fe); }
.gr-stat-card--blue .gr-stat-card__icon { background: linear-gradient(135deg, #cffafe, #a5f3fc); }
.gr-stat-card--green .gr-stat-card__icon { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
.gr-stat-card--orange .gr-stat-card__icon { background: linear-gradient(135deg, #ffedd5, #fed7aa); }
.gr-stat-card--teal .gr-stat-card__icon { background: linear-gradient(135deg, #ccfbf1, #99f6e4); }
.gr-stat-card--gold .gr-stat-card__icon { background: linear-gradient(135deg, #fef9c3, #fde047); }
.gr-stat-card--indigo .gr-stat-card__icon { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); }
.gr-stat-card--pink .gr-stat-card__icon { background: linear-gradient(135deg, #fce7f3, #fbcfe8); }
.gr-stat-card--cyan .gr-stat-card__icon { background: linear-gradient(135deg, #cffafe, #67e8f9); }
.gr-stat-card--emerald .gr-stat-card__icon { background: linear-gradient(135deg, #d1fae5, #6ee7b7); }

.gr-stat-card h3 {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 500;
}
.gr-stat-value {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: #1e293b;
}
.gr-stat-value--muted { font-size: 1rem; font-weight: 600; color: #94a3b8; }
.gr-stat-meta { margin: 0.25rem 0 0; font-size: 0.85rem; color: #64748b; }

.gr-section { margin-bottom: 2.5rem; }
.gr-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: #1e293b;
}

.gr-table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  box-shadow: var(--gr-shadow);
  background: var(--gr-card-bg);
}

.gr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.gr-table th {
  background: linear-gradient(135deg, var(--gr-primary), var(--gr-secondary));
  color: #fff;
  padding: 1rem;
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}
.gr-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}
.gr-table tbody tr:hover { background: rgba(124, 58, 237, 0.04); }
.gr-table tbody tr:last-child td { border-bottom: none; }

.gr-empty-state {
  text-align: center;
  padding: 3rem;
  background: var(--gr-card-bg);
  border-radius: 20px;
  box-shadow: var(--gr-shadow);
}
.gr-empty-icon { font-size: 3rem; display: block; margin-bottom: 1rem; }

.gr-club-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.gr-club-control-card {
  background: var(--gr-card-bg);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--gr-shadow);
  border: 1px solid rgba(255,255,255,0.7);
}
.gr-club-control-card h3 { margin: 0 0 0.5rem; font-size: 1rem; }

@media (max-width: 640px) {
  .gr-app { padding: 1rem 0.5rem; border-radius: 16px; }
  .gr-dashboard-header__content { padding: 1.5rem; }
  .gr-table { font-size: 0.8rem; }
  .gr-table th, .gr-table td { padding: 0.6rem; }
}
