/* Subscriptions page — Loom-style pricing */

.page-header { flex-wrap: wrap; }
.page-header h1 { width: 100%; }
.page-header p { font-size: 14px; color: #6b7280; margin-top: 4px; }

/* ── Per-card billing toggle ── */
.plan-billing-toggle {
    display: flex; align-items: center;
    background: #f3f4f6; border-radius: 999px; padding: 4px;
    margin: 0 28px 24px;
}
.plan-billing-btn {
    flex: 1; text-align: center;
    padding: 10px 0; border-radius: 999px;
    font-size: 14px; font-weight: 500; color: #6b7280;
    border: none; background: transparent;
    cursor: pointer; font-family: inherit;
    transition: all 0.2s; white-space: nowrap;
}
.plan-billing-btn.active {
    background: #fff; color: #111827; font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.plan-billing-save {
    display: inline-flex; align-items: center;
    background: #FFF3E0; color: #E65100; font-size: 10px;
    font-weight: 700; padding: 2px 7px; border-radius: 999px;
    margin-left: 6px; letter-spacing: 0.3px;
}

/* ── Subscription info ── */
.subscription-info {
    background: #fff;
    border-radius: 16px; padding: 0;
    margin-bottom: 24px; display: none;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}
.subscription-info-top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px;
    background: #f3f4f6;
}
.subscription-info-top h3 {
    font-size: 14px; font-weight: 600; color: #374151; margin: 0;
    display: flex; align-items: center; gap: 8px;
}
.subscription-info-top h3 svg { flex-shrink: 0; }
.subscription-auto-renew {
    display: flex; align-items: center; gap: 10px;
}
.subscription-auto-renew-label {
    font-size: 12px; font-weight: 500; color: #6b7280;
}

/* Toggle switch */
.toggle {
    position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #d1d5db; border-radius: 24px; transition: background 0.3s;
}
.toggle-slider::before {
    content: ''; position: absolute; width: 18px; height: 18px;
    left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-slider { background: #FF8C00; }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle input:disabled + .toggle-slider { cursor: not-allowed; opacity: 0.6; }
.subscription-info-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
    padding: 20px 24px;
}
.subscription-info-item {
    padding: 0 20px;
    position: relative;
}
.subscription-info-item::after {
    content: '';
    position: absolute; right: 0; top: 4px; bottom: 4px;
    width: 1px; background: #e5e7eb;
}
.subscription-info-item:last-child::after { display: none; }
.subscription-info-item:first-child { padding-left: 0; }
.subscription-info-item:last-child { padding-right: 0; }
.subscription-info-label {
    font-size: 11px; color: #9ca3af; margin-bottom: 6px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.3px;
}
.subscription-info-value { font-size: 15px; font-weight: 600; color: #111827; }
.subscription-info-value .plan-highlight { color: #FF8C00; font-weight: 700; }
.subscription-info-value .plan-price-tag {
    font-size: 15px; font-weight: 400; color: #6b7280;
}
/* Days left colors */
.subscription-info-value.days-ok { color: #059669; }
.subscription-info-value.days-warning { color: #d97706; }
.subscription-info-value.days-danger { color: #dc2626; }
.days-circle {
    display: inline-flex; align-items: center; gap: 6px;
}
.days-circle::before {
    content: '';
    width: 8px; height: 8px; border-radius: 50%;
    flex-shrink: 0;
}
.days-ok .days-circle::before { background: #059669; }
.days-warning .days-circle::before { background: #d97706; }
.days-danger .days-circle::before { background: #dc2626; }

.pending-plan-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: #fffbeb; color: #92400e; font-size: 12px;
    font-weight: 500; padding: 8px 14px; border-radius: 6px; margin-top: 14px;
    border: 1px solid #fde68a;
}
.btn-cancel-pending {
    background: #dc2626; color: #fff; border: none; border-radius: 4px;
    font-size: 11px; font-weight: 600; padding: 3px 10px;
    cursor: pointer; transition: background 0.15s;
}
.btn-cancel-pending:hover { background: #b91c1c; }

/* ── Plan cards grid ── */
.plans-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
    margin-bottom: 32px;
}

/* ── Plan card ── */
.plan-card {
    background: #fff; border-radius: 16px;
    border: 1px solid #e5e7eb;
    display: flex; flex-direction: column;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: visible;
}
.plan-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}


/* Current plan — subtle highlight */
.plan-card.current {
    border-color: #FF8C00;
    background: #FFFAF5;
}

/* Badge */
.plan-badge {
    position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
    font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
    padding: 6px 18px; border-radius: 999px;
    text-transform: uppercase; white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.5);
    background-image: linear-gradient(180deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.1) 50%, transparent 50%, rgba(255,255,255,0.05) 100%);
}
.plan-badge--current {
    background-color: #FF8C00; color: #fff;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}
.plan-badge--pending {
    background-color: #f59e0b; color: #fff;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}
.plan-badge--popular {
    background-color: #FF8C00; color: #fff;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

/* Header area */
.plan-header-area { padding: 32px 28px 0; }

.plan-icon { display: none; }

.plan-name {
    font-size: 20px; font-weight: 700; color: #111827; margin-bottom: 8px;
}
.plan-name-gold {
    display: inline-block;
    background: linear-gradient(90deg, #C9A24E 0%, #E8D48B 25%, #F5EAB8 50%, #E8D48B 75%, #C9A24E 100%);
    color: #5C3D0E;
    font-size: 12px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase;
    padding: 6px 18px; border-radius: 999px;
    border: 1px solid rgba(170,119,28,0.3);
    box-shadow: 0 1px 4px rgba(179,135,40,0.15);
}
.plan-name-silver {
    display: inline-block;
    background: linear-gradient(90deg, #8E8E8E 0%, #C8C8C8 25%, #E8E8E8 50%, #C8C8C8 75%, #8E8E8E 100%);
    color: #3A3A3A;
    font-size: 12px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase;
    padding: 6px 18px; border-radius: 999px;
    border: 1px solid rgba(120,120,120,0.3);
    box-shadow: 0 1px 4px rgba(100,100,100,0.15);
}
.plan-name-bronze {
    display: inline-block;
    background: linear-gradient(90deg, #A0714F 0%, #D4A87C 25%, #E8C9A8 50%, #D4A87C 75%, #A0714F 100%);
    color: #5C3518;
    font-size: 12px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase;
    padding: 6px 18px; border-radius: 999px;
    border: 1px solid rgba(140,90,50,0.3);
    box-shadow: 0 1px 4px rgba(140,90,50,0.15);
}
.plan-name-emerald {
    display: inline-block;
    background: linear-gradient(90deg, #047857 0%, #34d399 25%, #6ee7b7 50%, #34d399 75%, #047857 100%);
    color: #022c22;
    font-size: 12px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase;
    padding: 6px 18px; border-radius: 999px;
    border: 1px solid rgba(4,120,87,0.3);
    box-shadow: 0 1px 4px rgba(4,120,87,0.15);
}
.plan-desc {
    font-size: 14px; color: #6b7280; line-height: 1.5; margin-bottom: 20px;
    min-height: 42px;
}

/* Price */
.plan-price-area { padding: 0 28px 24px; }
.plan-price-row {
    display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.plan-price {
    font-size: 36px; font-weight: 700; color: #111827; line-height: 1;
    display: flex; align-items: baseline; gap: 4px;
}
.plan-price .currency { font-size: 16px; font-weight: 500; color: #6b7280; }
.plan-price .period { font-size: 14px; font-weight: 400; color: #9ca3af; }
.plan-price--free { font-size: 28px; color: #111827; }
.plan-old-price {
    font-size: 16px; color: #9ca3af; text-decoration: line-through;
    white-space: nowrap;
}
.plan-discount-badge {
    display: inline-block; font-size: 12px; font-weight: 600;
    color: #fff; background: #10b981; border-radius: 10px;
    padding: 2px 8px; margin-left: 6px; vertical-align: middle;
}

/* Button area */
.plan-btn-area { padding: 0 28px 24px; }

.btn-plan {
    width: 100%; padding: 12px; border-radius: 8px; font-size: 14px; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: all 0.15s;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-plan.primary { background: #FF8C00; color: #fff; border: none; }
.btn-plan.primary:hover { background: #E07B00; }
.btn-plan.secondary { background: transparent; color: #374151; border: 2px solid #e5e7eb; }
.btn-plan.secondary:hover { background: #f9fafb; border-color: #d1d5db; }
.btn-plan.cancel { background: #dc2626; color: #fff; border: none; }
.btn-plan.cancel:hover { background: #b91c1c; }
.btn-plan:disabled { opacity: 0.5; cursor: not-allowed; }

/* Recommended plan gets filled button, others get outlined */
.plan-card.recommended .btn-plan.primary { background: #FF8C00; color: #fff; }
.plan-card:not(.recommended):not(.current) .btn-plan.primary {
    background: transparent; color: #374151; border: 2px solid #e5e7eb;
}
.plan-card:not(.recommended):not(.current) .btn-plan.primary:hover {
    background: #f9fafb; border-color: #d1d5db;
}

/* Divider before features */
.plan-divider {
    height: 1px; background: #f3f4f6; margin: 0 28px;
}

/* Details / Features */
.plan-details {
    padding: 20px 28px 28px; flex: 1;
}

.plan-section-label {
    font-size: 13px; font-weight: 600; color: #374151;
    margin-bottom: 12px;
}
.plan-features + .plan-section-label { margin-top: 16px; }

.plan-features { list-style: none; margin: 0; padding: 0; }
.plan-features li {
    padding: 5px 0; font-size: 14px; color: #374151;
    display: flex; align-items: center; gap: 10px;
}
.plan-features .feat-icon { display: none; }
.plan-features .feat-check {
    color: #10b981; font-weight: 600; flex-shrink: 0; font-size: 16px;
}
.plan-features .feat-cross {
    color: #d1d5db; flex-shrink: 0; font-size: 16px;
}

.plan-toggle { display: none; }

/* ── Usage ── */
.usage-section {
    background: #fff; border-radius: 12px; padding: 24px 28px;
    border: 1px solid #e5e7eb; margin-bottom: 20px;
}
.usage-section h3 {
    font-size: 14px; font-weight: 600; margin-bottom: 20px; color: #374151;
}
.usage-section h3 svg { display: none; }

.usage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.usage-item {}
.usage-header {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 8px;
}
.usage-label { font-size: 14px; color: #374151; font-weight: 500; }
.usage-label svg { display: none; }
.usage-numbers {
    font-size: 14px; font-weight: 600; color: #111827;
}
.usage-numbers .usage-limit { font-weight: 400; color: #9ca3af; }

.usage-section .progress { height: 8px; border-radius: 4px; background: #f3f4f6; }
.usage-section .progress-fill { border-radius: 4px; background: #FF8C00; }
.usage-section .progress-fill.warning { background: #f59e0b; }
.usage-section .progress-fill.danger { background: #ef4444; }

.usage-pct { font-size: 12px; color: #9ca3af; margin-top: 4px; }
.usage-pct.warning { color: #d97706; }
.usage-pct.danger { color: #dc2626; }

/* ── History ── */
.history-section {
    background: #fff; border-radius: 12px; padding: 24px 28px;
    border: 1px solid #e5e7eb;
}
.history-section h3 {
    font-size: 14px; font-weight: 600; margin-bottom: 16px; color: #374151;
}
.history-section h3 svg { display: none; }

.history-list-header {
    display: flex; align-items: center; padding: 10px 0; gap: 16px;
    font-size: 11px; font-weight: 600; color: #9ca3af;
    text-transform: uppercase; letter-spacing: 0.3px;
    border-bottom: 1px solid #f3f4f6;
}
.hlh-date { width: 90px; flex-shrink: 0; }
.hlh-type { width: 100px; flex-shrink: 0; }
.hlh-old { flex: 1; min-width: 0; }
.hlh-new { flex: 1; min-width: 0; }
.hlh-amount { width: 80px; flex-shrink: 0; text-align: right; }

.history-cards { display: flex; flex-direction: column; }
.history-card {
    display: flex; align-items: center; padding: 12px 0; gap: 16px;
    font-size: 13px; border-bottom: 1px solid #f9fafb;
}
.history-card:last-child { border-bottom: none; }
.history-card:hover { background: #fafbfc; margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px; }
.hc-date { width: 90px; flex-shrink: 0; color: #6b7280; }
.hc-type { width: 100px; flex-shrink: 0; }
.hc-old { flex: 1; min-width: 0; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-new { flex: 1; min-width: 0; color: #374151; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-amount { width: 80px; flex-shrink: 0; text-align: right; font-weight: 600; color: #111827; }

.history-empty { text-align: center; color: #9ca3af; padding: 24px; font-size: 14px; }

.reason-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.reason-upgrade { background: #ecfdf5; color: #065f46; }
.reason-downgrade { background: #fffbeb; color: #92400e; }
.reason-first_assignment { background: #eff6ff; color: #1e40af; }
.reason-removal { background: #fef2f2; color: #991b1b; }
.reason-renewal { background: #f0fdf4; color: #166534; }
.reason-cancellation { background: #fef2f2; color: #991b1b; }

/* ── Modal ── */
.plan-modal-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4); z-index: 1000;
    align-items: center; justify-content: center;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.plan-modal-overlay.active { display: flex !important; }
.plan-modal {
    background: #fff; border-radius: 16px; padding: 32px; max-width: 440px; width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.plan-modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.plan-modal-summary {
    background: #f9fafb; border-radius: 10px; padding: 18px; margin-bottom: 16px;
}
.plan-modal-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.plan-modal-row.total {
    border-top: 1px solid #e5e7eb; margin-top: 8px; padding-top: 10px;
    font-weight: 700; font-size: 16px;
}
.plan-modal-row .label { color: #6b7280; }
.plan-modal-note { font-size: 13px; color: #6b7280; margin-bottom: 16px; line-height: 1.5; }
.plan-modal-actions { display: flex; gap: 10px; }
.plan-modal-actions button {
    flex: 1; padding: 12px; border-radius: 8px; font-size: 14px; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.btn-modal-cancel { background: #f3f4f6; color: #374151; border: none; }
.btn-modal-cancel:hover { background: #e5e7eb; }
.btn-modal-confirm { background: #FF8C00; color: #fff; border: none; }
.btn-modal-confirm:hover { background: #E07B00; }