:root {
    --sub-bg: #f5f5f5;
    --hero-page-bg: linear-gradient(180deg, #faf8f4 0%, #f3f1ec 45%, #ebe8e1 100%);
    --hero-teal: #1e5d7b;
    --hero-teal-hover: #174a63;
    --serial-input-bg: #f3f6f9;
    --card-bg: #ffffff;
    --badge-duration: #fef3c7;
    --badge-duration-text: #92400e;
    --badge-active: #d1fae5;
    --badge-active-text: #065f46;
    --badge-inactive: #e5e7eb;
    --badge-inactive-text: #4b5563;
    --btn-change: #f59e0b;
    --btn-change-hover: #d97706;
    --btn-subscribe: #0d9488;
    --btn-subscribe-hover: #0f766e;
    --btn-cancel-border: #d1d5db;
    --btn-cancel-text: #374151;
    --section-count-upcoming: #f59e0b;
    --section-count-active: #10b981;
    --section-count-inactive: #6b7280;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --cost-icon-color: #f59e0b;
    /* Hero vertical rhythm (match design spec; survives Bootstrap reboot) */
    --hero-gap-title-subtitle: 32px;
    --hero-gap-subtitle-card: 56px;
    /* Card elevation + primary CTA (match dashboard reference) */
    --card-shadow-rest: 0 1px 2px rgba(0, 0, 0, 0.045), 0 4px 16px rgba(0, 0, 0, 0.055);
    --card-shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.06), 0 10px 28px rgba(0, 0, 0, 0.075);
    --card-primary-yellow: #ffb400;
    --card-primary-yellow-hover: #eca000;
    --card-primary-yellow-text: #2a2a2a;
}

body {
    background: var(--hero-page-bg);
    background-color: #f3f1ec;
}

.subscription-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 20px 56px;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
}

/* ── Hero / Banner (scoped + explicit margins so theme/Bootstrap cannot collapse spacing) ── */
.subscription-page .subscription-hero {
    margin: 32px 0 40px;
    text-align: center;
}

.subscription-page .subscription-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

.subscription-page .subscription-hero h2.subscription-hero-title {
    font-size: clamp(28px, 3.6vw, 40px);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1a202c;
    margin: 0 0 var(--hero-gap-title-subtitle);
    width: 100%;
    text-align: center;
}

.subscription-page .subscription-hero p.subscription-hero-subtitle {
    margin: 0 0 var(--hero-gap-subtitle-card);
    padding: 0;
    max-width: 520px;
    width: 100%;
    font-size: 15px;
    line-height: 1.55;
    font-weight: 400;
    color: #718096;
    text-align: center;
}

.subscription-page .subscription-hero p.subscription-serial-line {
    margin: 0 0 var(--hero-gap-subtitle-card);
    padding: 0;
    max-width: 520px;
    width: 100%;
    font-size: 15px;
    line-height: 1.55;
    color: #6b7280;
    text-align: center;
}

.subscription-serial-line .subscription-serial-label {
    font-weight: 400;
    color: #6b7280;
}

.subscription-serial-line .subscription-serial-value {
    font-weight: 700;
    color: #1a1a1a;
}

.subscription-page .subscription-hero .subscription-hero-card {
    background: #ffffff;
    border: 1px solid #e8e4df;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(17, 24, 39, 0.08), 0 2px 8px rgba(17, 24, 39, 0.04);
    padding: 20px 22px;
    max-width: 640px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

/* Messages below hero (errors / OTP text) — no extra gap when empty */
.subscription-serial-messages {
    max-width: 720px;
    margin: 0 auto 8px;
    padding: 0 16px;
}

.subscription-serial-messages .row {
    --bs-gutter-x: 0;
}

.subscription-serial-messages .alert:not(.d-none) {
    margin-bottom: 0;
}

#subscriptionListingWrapper {
    margin-top: 22px;
    width: 100%;
    text-align: left;
}

#subscriptionContent {
    width: 100%;
    text-align: left;
}

.serial-input-wrap {
    display: flex;
    align-items: stretch;
    gap: 12px;
    flex-wrap: nowrap;
}

.serial-input-field-wrap {
    flex: 1;
    position: relative;
    min-width: 0;
}

.serial-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
    pointer-events: none;
}

.serial-input-wrap .form-control {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    height: 48px;
    padding-left: 42px;
    font-size: 15px;
    background: var(--serial-input-bg);
    color: #1a1a1a;
}

.serial-input-wrap .form-control::placeholder {
    color: #9ca3af;
}

.serial-input-wrap .form-control:focus {
    border-color: var(--hero-teal);
    box-shadow: 0 0 0 3px rgba(30, 93, 123, 0.12);
    background: #fff;
    outline: none;
}

.serial-input-wrap .form-control:read-only {
    cursor: default;
    background: var(--serial-input-bg);
}

.btn-serial-submit {
    border-radius: 10px;
    height: 48px;
    min-width: 120px;
    padding: 0 20px;
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    border: none;
    background: var(--hero-teal);
    color: #fff;
    transition: background 0.2s, transform 0.05s;
}

.btn-serial-submit:hover {
    background: var(--hero-teal-hover);
    color: #fff;
}

.btn-serial-submit .bi {
    color: #fff;
    vertical-align: -0.05em;
}

.btn-serial-switch {
    border-radius: 10px;
    height: 48px;
    min-width: 104px;
    padding: 0 20px;
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #1a1a1a;
    transition: border-color 0.2s, background 0.2s;
}

.btn-serial-switch:hover {
    border-color: #9ca3af;
    background: #fafafa;
}

.subscription-page .subscription-hero .btn-warning {
    border-radius: 10px;
    height: 48px;
    min-width: 120px;
    font-weight: 600;
}

/* ── Filter Bar ── */
.filter-bar {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.filter-bar .filter-controls {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    min-width: 0;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 16px;
    background: var(--card-bg);
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color .2s, background .2s;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: #d1d5db;
    background: #fafafa;
}

.filter-btn.active,
.filter-select:focus {
    border-color: var(--hero-teal);
}

.filter-select {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 32px 8px 14px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--card-bg);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    outline: none;
}

.sub-count {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    text-align: left;
}

/* ── View Toggle ── */
.view-toggle {
    display: flex;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.view-toggle button {
    border: none;
    background: var(--card-bg);
    padding: 8px 12px;
    font-size: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .2s, color .2s;
    line-height: 1;
}

.view-toggle button.active {
    background: var(--hero-teal);
    color: #fff;
}

.view-toggle button:not(.active):hover {
    background: #f9fafb;
}

/* ── Section Header (dashboard-style) ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin: 32px 0 18px;
    text-align: left;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #152a45;
    margin: 0;
    letter-spacing: -0.01em;
}

.section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.section-count.upcoming { background: var(--section-count-upcoming); }
.section-count.active   { background: var(--section-count-active); }
.section-count.inactive { background: var(--section-count-inactive); }

/* ── Subscription Cards Grid ── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    align-items: stretch;
    width: 100%;
    justify-content: start;
    justify-items: stretch;
}

.cards-grid.one-col {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin: 0;
}

/* ── List View ── */
.cards-grid.list-view {
    grid-template-columns: 1fr !important;
    max-width: 100% !important;
}

.cards-grid.list-view .sub-card {
    display: grid;
    grid-template-columns: minmax(0, 220px) 1fr auto;
    align-items: center;
    gap: 20px;
}

.cards-grid.list-view .card-header {
    margin-bottom: 0;
}

.cards-grid.list-view .card-header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.cards-grid.list-view .card-details {
    display: flex;
    gap: 28px;
}

.cards-grid.list-view .card-details .detail-row {
    margin-bottom: 0;
}

.cards-grid.list-view .card-actions {
    flex-direction: row;
    gap: 10px;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* ── Card (accent bar + shadow + footer separator) ── */
.sub-card {
    --card-accent: var(--hero-teal);
    background: var(--card-bg);
    border: 1px solid #e8eaed;
    border-radius: 10px;
    padding: 20px 20px 20px 22px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
    box-shadow: var(--card-shadow-rest);
}

.sub-card[data-section="upcoming"] {
    --card-accent: #ea580c;
}

.sub-card[data-section="active"] {
    --card-accent: #0284c7;
}

.sub-card[data-section="inactive"] {
    --card-accent: #dc2626;
}

.sub-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--card-accent);
    border-radius: 10px 0 0 10px;
    pointer-events: none;
}

.sub-card:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: #dce0e6;
}

.card-header {
    margin-bottom: 14px;
}

.card-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.card-header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.card-product-name {
    font-size: 16px;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
    line-height: 1.35;
    text-align: left;
    flex: 1;
    min-width: 0;
}

.badge-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

.badge-duration {
    background: var(--badge-duration);
    color: var(--badge-duration-text);
}

.badge-active.badge-tone-active {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-active.badge-tone-expiring {
    background: #ffedd5;
    color: #c2410c;
}

.badge-inactive.badge-tone-inactive {
    background: #fee2e2;
    color: #b91c1c;
}

.card-action-menu {
    position: relative;
    flex-shrink: 0;
}

.card-more-btn {
    border: none;
    background: none;
    padding: 6px 8px;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.card-more-btn:hover {
    background: #f1f5f9;
    color: #334155;
}

.action-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.06);
    z-index: 100;
    padding: 6px 0;
    animation: dropdownFadeIn .15s ease-out;
}

.action-dropdown.open {
    display: block;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.action-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background .15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.action-dropdown-item:hover {
    background: #f9fafb;
}

.action-dropdown-item .action-icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.action-dropdown-item.action-cancel {
    color: #f59e0b;
}

.action-dropdown-item.action-cancel .action-icon {
    color: #f59e0b;
}

.action-dropdown-item.action-subscribe-link {
    color: var(--btn-subscribe);
}

.action-dropdown-item.action-subscribe-link .action-icon {
    color: var(--btn-subscribe);
}

.card-details {
    margin-bottom: 0;
    padding-bottom: 16px;
}

.detail-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
    font-size: 14px;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
}

.detail-label .icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
}

.detail-label .icon.cost-icon { color: #ea580c; }
.detail-label .icon.billing-icon { color: #94a3b8; }
.detail-label .icon.users-icon { color: #94a3b8; }

.detail-value {
    font-weight: 600;
    color: #1e293b;
    text-align: right;
    font-size: 14px;
}

.detail-row:first-child .detail-value {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}

/* ── Card actions: top separator, left-aligned CTAs ── */
.card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 0;
    padding-top: 16px;
    border-top: 1px solid #e8eaed;
}

/* Card CTAs: yellow primary (Subscribe / checkout), white secondary (Change plan) */
.card-actions .btn-change-plan {
    flex: 0 1 auto;
    min-width: min(100%, 132px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-change-plan.btn-card-primary {
    background: var(--card-primary-yellow);
    color: var(--card-primary-yellow-text);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.btn-change-plan.btn-card-primary:hover {
    background: var(--card-primary-yellow-hover);
    color: var(--card-primary-yellow-text);
}

.btn-change-plan.btn-card-secondary {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    box-shadow: none;
}

.btn-change-plan.btn-card-secondary:hover {
    background: #f9fafb;
    color: #1f2937;
    border-color: #bfc4ca;
}

.btn-cancel-sub {
    flex: 0 1 auto;
    min-width: min(100%, 132px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-cancel-sub:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #1f2937;
}

.btn-subscribe {
    flex: 0 1 auto;
    min-width: min(100%, 132px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    background: var(--card-primary-yellow);
    color: var(--card-primary-yellow-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.btn-subscribe:hover {
    background: var(--card-primary-yellow-hover);
    color: var(--card-primary-yellow-text);
}

/* ── Empty States ── */
.empty-section {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ── Loading Skeleton ── */
.skeleton-card {
    background: var(--card-bg);
    border: 1px solid #e8eaed;
    border-radius: 10px;
    padding: 20px;
    min-height: 200px;
    box-shadow: var(--card-shadow-rest);
}

.skeleton-line {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: 12px;
}

.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-100 { width: 100%; }
.skeleton-line.h-lg { height: 20px; }

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Responsive ── */

/* Tablet landscape / small desktop */
@media (max-width: 1024px) {
    .subscription-page {
        max-width: 100%;
        padding: 20px 16px 40px;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
}

/* Tablet portrait */
@media (max-width: 768px) {
    .subscription-page {
        padding: 16px 12px 36px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 14px 16px;
        gap: 10px;
    }

    .subscription-page .subscription-hero .subscription-hero-card {
        padding: 12px;
    }

    .serial-input-wrap {
        flex-direction: column;
    }

    .subscription-page .subscription-hero .btn-warning,
    .btn-serial-submit,
    .btn-serial-switch {
        width: 100%;
        min-width: 0;
    }

    .filter-controls {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        justify-content: flex-start;
    }

    .filter-select,
    .filter-btn {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
    }

    .view-toggle {
        margin-left: auto;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 12px;
    }

    .cards-grid.one-col {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .cards-grid.list-view .sub-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .cards-grid.list-view .card-details {
        flex-direction: column;
        gap: 6px;
    }

    .cards-grid.list-view .card-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .section-header {
        margin: 22px 0 12px;
    }

    .section-header h2 {
        font-size: 16px;
    }
}

/* Mobile landscape / large phone */
@media (max-width: 576px) {
    .subscription-page {
        padding: 12px 10px 32px;
        --hero-gap-title-subtitle: 24px;
        --hero-gap-subtitle-card: 44px;
    }

    .subscription-page .subscription-hero {
        margin-top: 8px;
    }

    .subscription-page .subscription-hero p.subscription-hero-subtitle {
        font-size: 14px;
    }

    .filter-bar {
        padding: 12px;
        gap: 8px;
        border-radius: 10px;
    }

    .filter-select,
    .filter-btn {
        flex: 1 1 100%;
        font-size: 13px;
        padding: 8px 12px;
    }

    .filter-select {
        background-position: right 8px center;
    }

    .view-toggle {
        width: 100%;
        justify-content: center;
    }

    .view-toggle button {
        flex: 1;
        text-align: center;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .sub-card {
        padding: 16px 16px 16px 18px;
        border-radius: 10px;
    }

    .card-header {
        margin-bottom: 12px;
    }

    .card-header-top {
        flex-wrap: wrap;
        gap: 8px;
    }

    .card-product-name {
        font-size: 15px;
        flex: 1 1 auto;
    }

    .card-header-meta {
        margin-top: 8px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .badge-pill {
        font-size: 11px;
        padding: 3px 10px;
    }

    .detail-row {
        font-size: 13px;
        gap: 12px;
    }

    .detail-label {
        min-width: 100px;
        gap: 6px;
    }

    .card-actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn-change-plan,
    .btn-cancel-sub,
    .btn-subscribe {
        width: 100%;
        justify-content: center;
        padding: 10px 14px;
        font-size: 13px;
    }

    .section-header h2 {
        font-size: 15px;
    }

    .section-count {
        width: 22px;
        height: 22px;
        font-size: 12px;
    }

    .sub-count {
        font-size: 12px;
    }

    .no-results i {
        font-size: 36px;
    }

    .no-results h3 {
        font-size: 16px;
    }

    .no-results p {
        font-size: 13px;
    }
}

/* Small phone */
@media (max-width: 380px) {
    .subscription-page {
        padding: 8px 8px 24px;
    }

    .filter-bar {
        padding: 10px;
    }

    .sub-card {
        padding: 14px;
    }

    .detail-label {
        min-width: 85px;
        font-size: 12px;
    }

    .detail-value {
        font-size: 12px;
    }

    .card-product-name {
        font-size: 14px;
    }
}

/* ── No-results ── */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    color: #d1d5db;
}

.no-results h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.no-results p {
    font-size: 14px;
}

/* ══════════════════════════════════════════════════
   SUBSCRIPTION DETAIL VIEW
   ══════════════════════════════════════════════════ */

.detail-view {
    animation: detailFadeIn .25s ease-out;
}

@keyframes detailFadeIn {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: 8px;
    transition: color .2s;
}

.back-btn:hover {
    color: var(--btn-change);
}

.back-btn i {
    font-size: 16px;
}

.detail-page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.detail-page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 24px;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    align-items: start;
}

/* ── Left: Product Info Card ── */
.detail-product-card {
    background: var(--card-bg);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px 28px;
}

.detail-product-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.detail-product-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.detail-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 40px;
}

.detail-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-info-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.detail-info-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ── Right: Sidebar ── */
.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-quick-info {
    background: var(--card-bg);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 22px 24px;
}

.detail-quick-info h3,
.detail-actions-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px;
}

.quick-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
}

.quick-info-row:last-child {
    border-bottom: none;
}

.quick-info-label {
    color: var(--text-secondary);
}

.quick-info-value {
    font-weight: 600;
    color: var(--text-primary);
}

.detail-actions-card {
    background: var(--card-bg);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 22px 24px;
}

.detail-actions-card .detail-action-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-detail-cancel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-detail-cancel:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #1f2937;
}

.btn-detail-change {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-detail-change:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #1f2937;
}

.btn-detail-subscribe {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    background: var(--card-primary-yellow);
    color: var(--card-primary-yellow-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-detail-subscribe:hover {
    background: var(--card-primary-yellow-hover);
    color: var(--card-primary-yellow-text);
}

/* ── Detail View Responsive ── */
@media (max-width: 768px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-product-card {
        padding: 20px;
    }

    .detail-info-grid {
        gap: 16px 24px;
    }

    .detail-info-value {
        font-size: 15px;
    }

    .detail-page-title {
        font-size: 20px;
    }
}

@media (max-width: 576px) {
    .detail-info-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .detail-product-card {
        padding: 16px;
    }

    .detail-product-name {
        font-size: 17px;
    }

    .detail-page-title {
        font-size: 18px;
    }

    .quick-info-row {
        font-size: 13px;
    }
}

/* ══════════════════════════════════════════════════
   CHANGE PLAN MODAL
   ══════════════════════════════════════════════════ */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
}

.plan-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    animation: modalSlideIn .2s ease-out;
}

.plan-modal.plan-modal--cloud {
    max-width: 960px;
}

.plan-modal.plan-modal--cloud .modal-footer-btns {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.plan-modal.plan-modal--cloud .btn-modal-cancel,
.plan-modal.plan-modal--cloud .btn-modal-confirm {
    flex: 0 1 auto;
    min-width: 140px;
}

.modal-plan-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 8px 0 0;
    line-height: 1.45;
}

.modal-plan-subtitle strong {
    color: var(--text-primary);
    font-weight: 600;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 2px;
}

.modal-product-name {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color .2s;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

/* ── Plan Option Cards ── */
.plan-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.plan-option {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 20px;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 14px;
    align-items: start;
}

.plan-option:hover {
    border-color: #cbd5e1;
}

.plan-option.selected {
    border-color: #0d9488;
    box-shadow: 0 0 0 1px #0d9488;
}

.plan-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    transition: border-color .2s;
    flex-shrink: 0;
}

.plan-option.selected .plan-radio {
    border-color: #0d9488;
}

.plan-radio-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: transparent;
    transition: background .2s;
}

.plan-option.selected .plan-radio-dot {
    background: #0d9488;
}

.plan-info h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.plan-save-badge {
    display: inline-block;
    background: #d1fae5;
    color: #065f46;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.plan-features li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 2px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.plan-features li::before {
    content: '✓';
    color: #0d9488;
    font-weight: 700;
    font-size: 13px;
}

.plan-pricing {
    text-align: right;
    white-space: nowrap;
}

.plan-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.plan-price-period {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
}

.plan-price-monthly {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

/* ── TallyPrime Cloud / Server Cloud: plan grid (from AWS picklist) ── */
.plan-options.plan-options--cloud-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .plan-options.plan-options--cloud-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .plan-options.plan-options--cloud-grid {
        grid-template-columns: 1fr;
    }
}

.plan-option.plan-option--cloud {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
    padding: 16px 14px 14px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    min-height: 120px;
}

.plan-option.plan-option--cloud:hover {
    border-color: #93c5fd;
}

.plan-option.plan-option--cloud.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

.plan-option.plan-option--cloud.is-current-plan {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}

.plan-option.plan-option--cloud.is-current-plan.selected {
    border-color: #2563eb;
}

.plan-option--cloud .plan-cloud-check {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.15rem;
    color: #2563eb;
    line-height: 1;
    opacity: 0;
}

.plan-option--cloud.selected .plan-cloud-check {
    opacity: 1;
}

.plan-option--cloud .plan-cloud-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
    padding-right: 22px;
}

.plan-option--cloud .plan-cloud-users {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 auto;
    min-height: 1.25em;
}

.plan-option--cloud .plan-cloud-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 10px;
}

.plan-option--cloud .plan-cloud-current-label {
    margin-top: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    color: #2563eb;
    text-transform: uppercase;
}

.plan-option--cloud:not(.is-current-plan) .plan-cloud-current-label {
    display: none;
}

/* ── Note Box ── */
.plan-note {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.plan-note p {
    font-size: 13px;
    color: #1e40af;
    margin: 0;
    line-height: 1.5;
}

.plan-note strong {
    font-weight: 600;
}

/* ── Modal Footer Buttons ── */
.modal-footer-btns {
    display: flex;
    gap: 12px;
}

.btn-modal-cancel {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}

.btn-modal-cancel:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-modal-confirm {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: #0d9488;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

.btn-modal-confirm:hover {
    background: #0f766e;
}

/* ── Modal Responsive ── */
@media (max-width: 576px) {
    .plan-modal.plan-modal--cloud {
        max-width: 100%;
    }

    .plan-modal {
        padding: 20px;
        border-radius: 14px;
    }

    .plan-option {
        grid-template-columns: 24px 1fr;
        gap: 10px;
        padding: 14px 16px;
    }

    .plan-pricing {
        grid-column: 2;
        text-align: left;
        margin-top: 4px;
    }

    .plan-price {
        font-size: 17px;
        display: inline;
    }

    .plan-price-period {
        display: inline;
        margin-left: 4px;
    }

    .modal-footer-btns {
        flex-direction: column-reverse;
    }

    .modal-title {
        font-size: 18px;
    }
}

/* ══════════════════════════════════════════════════
   CANCEL SUBSCRIPTION MODAL
   ══════════════════════════════════════════════════ */

.cancel-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    animation: modalSlideIn .2s ease-out;
}

.cancel-modal .modal-header-row {
    margin-bottom: 8px;
}

.cancel-question {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.cancel-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 20px;
    line-height: 1.5;
}

.cancel-warning-box {
    background: #fef9e7;
    border: 1px solid #f59e0b;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.cancel-warning-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #d97706;
    margin: 0 0 10px;
}

.cancel-warning-title i {
    font-size: 16px;
}

.cancel-warning-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cancel-warning-list li {
    font-size: 13px;
    color: #92400e;
    padding: 3px 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
}

.cancel-warning-list li::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #d97706;
    flex-shrink: 0;
    margin-top: 6px;
}

.cancel-footer-btns {
    display: flex;
    gap: 12px;
}

.btn-cancel-goback {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}

.btn-cancel-goback:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-cancel-confirm {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: #38bdf8;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

.btn-cancel-confirm:hover {
    background: #0ea5e9;
}

@media (max-width: 576px) {
    .cancel-modal {
        padding: 20px;
    }

    .cancel-question {
        font-size: 16px;
    }

    .cancel-footer-btns {
        flex-direction: column-reverse;
    }
}
