/* ==============================================
   GoodMood Platform Detail — Subscription Tables,
   Active Packs, Sub Management
   ============================================== */

/* --- Active Pack Cards --- */
.gm-active-pack { display: flex; align-items: center; gap: 0.875rem; padding: 1rem 1.25rem; background: var(--gm-color-white); border: 1px solid var(--gm-color-border); border-radius: var(--gm-radius); transition: var(--gm-transition); }
.gm-active-pack:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); transform: translateY(-2px); }
.gm-active-pack-icon { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; background: color-mix(in srgb, var(--pack-color) 12%, transparent); color: var(--pack-color); transition: var(--gm-transition); }
.gm-active-pack:hover .gm-active-pack-icon { background: var(--pack-color); color: white; }
.gm-active-pack-info { display: flex; flex-direction: column; gap: 0.15rem; }
.gm-active-pack-name { font-family: var(--gm-font-heading); font-size: 0.9375rem; font-weight: 600; color: var(--gm-color-dark); }
.gm-active-pack-status { font-size: 0.75rem; font-weight: 500; color: #10b981; }

/* --- Subscription Tables --- */
.gm-subs-table-wrap { overflow-x: auto; }
.gm-subs-table { width: 100%; border-collapse: separate; border-spacing: 0; font-family: 'Inter', sans-serif; font-size: 0.875rem; table-layout: fixed; margin: 0; }
.gm-subs-table thead th:nth-child(1) { width: 40%; }
.gm-subs-table thead th:nth-child(2) { width: 15%; }
.gm-subs-table thead th:nth-child(3) { width: 30%; }
.gm-subs-table thead th:nth-child(4) { width: 15%; }
.gm-subs-table thead th { text-align: left; padding: 0.75rem 1.25rem; font-size: 0.7rem; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid #f3f4f6; white-space: nowrap; }
.gm-subs-table tbody tr { transition: background 0.15s; }
.gm-subs-table tbody tr:hover { background: #fafafa; }
.gm-subs-table tbody td { padding: 0.875rem 1.25rem; color: #374151; vertical-align: middle; white-space: nowrap; border-bottom: 1px solid #f9fafb; }
.gm-subs-table tbody tr:last-child td { border-bottom: none; }

/* Type column */
.gm-subs-type { display: flex; align-items: center; gap: 0.625rem; font-weight: 600; color: #0E0E0E; }
.gm-subs-type-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--type-color) 12%, transparent); color: var(--type-color); font-size: 0.8125rem; }

/* Details column */
.gm-subs-details-cell { white-space: normal !important; max-width: 320px; }
.gm-subs-detail-text { display: inline-flex; align-items: center; gap: 0.375rem; font-weight: 500; color: #374151; }
.gm-subs-detail-text i { color: #9ca3af; font-size: 0.75rem; }

/* Cycle label */
.gm-subs-cycle { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 500; background: #f3f4f6; color: #6b7280; }

/* Renewal cell */
.gm-subs-renewal-cell { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: #374151; }
.gm-subs-days { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 0.6875rem; font-weight: 600; background: #ecfdf5; color: #059669; }
.gm-subs-days.today { background: #fff7ed; color: #d97706; }

/* Actions cell */
.gm-subs-actions-cell { text-align: center; }

/* Table footer */
.gm-subs-table-footer { display: flex; justify-content: flex-end; padding: 0.875rem 1.25rem; border-top: 1px solid #f3f4f6; }

/* --- Subscription Groups --- */
.gm-subs-group { margin-bottom: 1.5rem; border: none; border-radius: 0; overflow: hidden; background: transparent; }
.gm-subs-group:last-of-type { margin-bottom: 0; }
.gm-subs-group-header { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0.5rem; border-bottom: none; background: transparent; }
.gm-subs-group-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--group-color) 10%, transparent); color: var(--group-color); font-size: 0.8125rem; flex-shrink: 0; }
.gm-subs-group-title { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; font-size: 0.875rem; font-weight: 700; color: #111827; line-height: 1.3; }
.gm-subs-group-desc { font-size: 0.7rem; color: #9ca3af; margin-top: 1px; }
.gm-subs-group .gm-subs-table-wrap { overflow-x: auto; }
.gm-subs-group .gm-subs-table { border-collapse: separate; border-spacing: 0; border: none; }

/* Outer border on cells */
.gm-subs-group .gm-subs-table thead th { background: #fafafa; border-top: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb; }
.gm-subs-group .gm-subs-table thead th:first-child, .gm-subs-group .gm-subs-table tbody td:first-child { border-left: 1px solid #e5e7eb; }
.gm-subs-group .gm-subs-table thead th:last-child, .gm-subs-group .gm-subs-table tbody td:last-child { border-right: 1px solid #e5e7eb; }
.gm-subs-group .gm-subs-table tbody td { border-bottom: 1px solid #e5e7eb; }

/* Rounded corners */
.gm-subs-group .gm-subs-table thead th:first-child { border-top-left-radius: 10px; }
.gm-subs-group .gm-subs-table thead th:last-child { border-top-right-radius: 10px; }
.gm-subs-group .gm-subs-table tbody tr:last-child td:first-child { border-bottom-left-radius: 10px; }
.gm-subs-group .gm-subs-table tbody tr:last-child td:last-child { border-bottom-right-radius: 10px; }

/* Row separator */
.gm-subs-group .gm-subs-table tbody tr:not(:last-child) td { border-bottom-color: #f0f1f3; }
.gm-subs-group .gm-subs-table tbody tr:last-child td { border-bottom: 1px solid #e5e7eb; }

/* Hover & weight */
.gm-subs-group .gm-subs-table tbody tr:hover { background: #f9fafb; }
.gm-subs-group .gm-subs-table tbody td:first-child { font-weight: 500; }

#gestion { padding-bottom: 1rem; }

/* --- Pack Mini-Badge (in subs table) --- */
.gm-pack-mini-badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.6rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; color: white; background: #6b7280; }
.gm-pack-mini-badge i { font-size: 0.65rem; }

/* --- Sub Management Loading --- */
.gm-sub-management-loading { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 0; }

/* --- Subscription Management Cards --- */
.gm-sub-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.gm-sub-section { margin-bottom: 1.25rem; }
.gm-sub-section:last-child { margin-bottom: 0; }
.gm-sub-section-title { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 600; color: #374151; margin-bottom: 0.75rem; }
.gm-sub-card { background: white; border: 1px solid #e5e7eb; border-radius: 0.75rem; padding: 1.25rem; transition: box-shadow 0.2s; }
.gm-sub-card-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.gm-sub-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.gm-sub-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.gm-sub-card-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.938rem; color: #111827; }
.gm-sub-card-packs { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 0.75rem; }
.gm-sub-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.gm-sub-meta-item { display: flex; align-items: center; gap: 0.375rem; font-size: 0.8rem; color: #6b7280; }
.gm-sub-meta-item i { font-size: 0.7rem; color: #9ca3af; }
.gm-sub-renewal { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem; background: #f9fafb; border-radius: 0.5rem; border: 1px solid #f3f4f6; }
.gm-sub-renewal > i { font-size: 1rem; color: #FFA44E; margin-top: 0.15rem; }
.gm-sub-renewal-label { font-size: 0.75rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 500; }
.gm-sub-renewal-date { font-size: 0.938rem; font-weight: 600; color: #111827; margin-top: 0.1rem; }
.gm-sub-renewal-days { font-size: 0.8rem; color: #6b7280; margin-top: 0.1rem; }
.gm-sub-card-actions { display: flex; justify-content: flex-end; padding-top: 0.75rem; margin-top: 0.75rem; border-top: 1px solid #f3f4f6; }
.gm-invoice-btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 6px 16px; border-radius: 999px; font-size: 0.8125rem; font-weight: 500; text-decoration: none; transition: all 0.3s linear; }
.gm-invoice-btn i { font-size: 0.75rem; }

/* --- Cancellation Banner --- */
.gm-cancel-banner { display: flex; align-items: flex-start; gap: 1rem; padding: 1.25rem 1.5rem; border-radius: 12px; margin-bottom: 1.5rem; border: 1px solid; animation: gm-slideDown 0.3s ease-out; }
.gm-cancel-banner.warning { background: linear-gradient(135deg, #fffbeb, #fef3c7); border-color: #fbbf24; }
.gm-cancel-banner.danger { background: linear-gradient(135deg, #fef2f2, #fee2e2); border-color: #f87171; }
.gm-cancel-banner-icon { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.125rem; }
.gm-cancel-banner.warning .gm-cancel-banner-icon { background: #fbbf24; color: white; }
.gm-cancel-banner.danger .gm-cancel-banner-icon { background: #ef4444; color: white; }
.gm-cancel-banner-content { flex: 1; }
.gm-cancel-banner-title { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; font-weight: 700; font-size: 0.9375rem; color: #111827; margin-bottom: 0.25rem; }
.gm-cancel-banner-text { font-size: 0.8125rem; color: #374151; line-height: 1.6; }
.gm-cancel-banner-text strong { color: #111827; }
.gm-cancel-banner-dates { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.75rem; }
.gm-cancel-banner-date { display: flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; font-weight: 500; padding: 0.25rem 0.75rem; border-radius: 999px; }
.gm-cancel-banner.warning .gm-cancel-banner-date { background: #fef3c7; color: #92400e; }
.gm-cancel-banner.danger .gm-cancel-banner-date { background: #fee2e2; color: #991b1b; }
.gm-cancel-banner-actions { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }

/* --- Danger Button (solid) --- */
.gm-btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626) !important; color: white !important; border: none !important; transition: all 0.25s ease !important; }
.gm-btn-danger:hover { background: linear-gradient(135deg, #dc2626, #b91c1c) !important; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35); }
.gm-btn-danger:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* --- Download Button --- */
.gm-btn-download { background: linear-gradient(135deg, #3b82f6, #2563eb) !important; color: white !important; border: none !important; transition: all 0.25s ease !important; }
.gm-btn-download:hover { background: linear-gradient(135deg, #2563eb, #1d4ed8) !important; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35); }

/* --- Cancel confirmation modal extras --- */
.gm-cancel-confirm-input { width: 100%; padding: 0.75rem 1rem; border: 1.5px solid #e5e7eb; border-radius: 10px; font-family: 'Inter', sans-serif; font-size: 0.875rem; outline: none; transition: border-color 0.2s; }
.gm-cancel-confirm-input:focus { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1); }
.gm-cancel-confirm-input.valid { border-color: #ef4444; }
.gm-cancel-summary { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px; padding: 1rem 1.25rem; margin: 0.75rem 0; }
.gm-cancel-summary-row { display: flex; justify-content: space-between; align-items: center; padding: 0.375rem 0; font-size: 0.8125rem; }
.gm-cancel-summary-row:not(:last-child) { border-bottom: 1px solid #f3f4f6; }
.gm-cancel-summary-label { color: #6b7280; }
.gm-cancel-summary-value { font-weight: 600; color: #111827; }
.gm-cancel-summary-value.danger { color: #ef4444; }

@keyframes gm-slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
