/* ==========================================================================
   SUBSCRIPTION PLANS ADMIN - CSS
   Styles for admin interface to manage subscription plans
   ========================================================================== */

.plans-admin-container {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    background: linear-gradient(135deg, #fef8f0 0%, #ffffff 100%);
    min-height: calc(100vh - 100px);
    border-radius: 20px;
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #d4a574, #c49464);
    color: white;
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #c49464, #b48454);
    box-shadow: 0 6px 16px rgba(212, 165, 116, 0.4);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn i {
    font-size: 14px;
}

/* Admin Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    padding: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.admin-header > div {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-header .subtitle {
    color: #10b981;
    font-size: 14px;
    font-weight: 600;
    margin: -8px 0 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-header .subtitle i {
    font-size: 16px;
}

.section-description {
    color: #64748b;
    font-size: 14px;
    margin: -10px 0 20px 0;
    line-height: 1.6;
}

/* Info Accordion */
.info-accordion {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    margin-bottom: 30px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    cursor: pointer;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    transition: all 0.3s ease;
}

.accordion-header:hover {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
}

.accordion-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #0369a1;
}

.accordion-title i {
    font-size: 20px;
}

.accordion-icon {
    font-size: 14px;
    color: #0369a1;
    transition: transform 0.3s ease;
}

.info-accordion.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.info-accordion.active .accordion-content {
    max-height: 1000px;
    padding: 30px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: linear-gradient(135deg, #fef8f0 0%, #ffffff 100%);
    border: 2px solid #f0e6d6;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(212, 165, 116, 0.15);
    border-color: #d4a574;
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.info-card-header i {
    font-size: 24px;
    color: #d4a574;
}

.info-card-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}

.info-card p {
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.info-card ul {
    margin: 0;
    padding-left: 20px;
}

.info-card ul li {
    color: #64748b;
    font-size: 13px;
    line-height: 1.8;
    margin-bottom: 6px;
}

.info-example {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #bbf7d0;
    border-radius: 12px;
    padding: 20px;
}

.example-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: #15803d;
    font-size: 16px;
}

.example-header i {
    font-size: 20px;
}

.example-content p {
    color: #166534;
    font-size: 14px;
    line-height: 1.8;
    margin: 8px 0;
    padding-left: 20px;
    position: relative;
}

.example-content p::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #22c55e;
    font-weight: bold;
}

.admin-header h1 {
    font-size: 2rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-weight: 700;
}

.admin-header h1 i {
    color: #d4a574;
    font-size: 2rem;
}

.org-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #fef8f0, #fff);
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid #f0e6d6;
}

.org-selector label {
    font-weight: 600;
    color: #64748b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.org-selector label i {
    color: #d4a574;
    font-size: 16px;
}

.org-selector select {
    min-width: 300px;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    color: #1e293b;
}

.org-selector select:hover {
    border-color: #d4a574;
    background: #fffbf5;
}

.org-selector select:focus {
    outline: none;
    border-color: #d4a574;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
}

/* Plans Grid */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 28px;
    margin-bottom: 50px;
    padding: 0 4px;
}

.plan-card {
    background: white;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 12px 40px rgba(212, 165, 116, 0.12), 0 4px 16px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #d4a574, #c49464);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.plan-card:hover::before {
    opacity: 1;
}

.plan-card:hover {
    box-shadow: 0 16px 48px rgba(212, 165, 116, 0.18), 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-6px);
    border-color: #f0e6d6;
}

.plan-card.default {
    border-color: #d4a574;
    background: linear-gradient(135deg, #fffbf5, #ffffff);
}

.plan-card.default::before {
    opacity: 1;
    height: 6px;
}

.plan-card.no-stripe {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #fffbeb, #ffffff);
}

.plan-card.no-stripe::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
    opacity: 1;
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
}

.plan-header h3 {
    font-size: 1.75rem;
    color: #1e293b;
    margin: 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge-primary {
    background: linear-gradient(135deg, #d4a574, #c49464);
    color: white;
    box-shadow: 0 2px 8px rgba(212, 165, 116, 0.3);
}

.badge-secondary {
    background: #e2e8f0;
    color: #64748b;
}

.badge-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.badge-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.plan-description {
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.7;
    font-size: 14px;
    min-height: 40px;
}

.plan-pricing {
    background: linear-gradient(135deg, #fef8f0, #f8fafc);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    border: 2px solid #f0e6d6;
}

.price-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.price-option.yearly {
    border-top: 2px solid #e2e8f0;
    margin-top: 10px;
    padding-top: 18px;
}

.price-label {
    color: #64748b;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.price-label i {
    color: #d4a574;
}

.price-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.discount-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 800;
    margin-left: 8px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    letter-spacing: 0.5px;
}

.plan-features {
    margin-bottom: 24px;
}

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

.features-list li {
    padding: 10px 0;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.features-list li i {
    color: #10b981;
    font-size: 1rem;
    min-width: 18px;
}

.no-features {
    color: #94a3b8;
    font-style: italic;
    margin: 0;
    padding: 20px;
    text-align: center;
    background: #f8fafc;
    border-radius: 8px;
}

.plan-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f1f5f9;
}

.plan-actions .btn {
    flex: 1;
    justify-content: center;
}

/* Stripe Warning */
.stripe-warning {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 2px solid #fbbf24;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #92400e;
}

.stripe-warning i {
    color: #f59e0b;
    font-size: 1.25rem;
    margin-top: 2px;
}

.stripe-warning span {
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
}

/* User Access Section */
.user-access-section {
    margin-top: 60px;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(212, 165, 116, 0.12), 0 4px 16px rgba(0,0,0,0.06);
}

.user-access-section h2 {
    font-size: 1.75rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    font-weight: 700;
}

.user-access-section h2 i {
    color: #d4a574;
    font-size: 1.75rem;
}

.user-access-table {
    width: 100%;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 2px solid #f1f5f9;
}

.user-access-table thead {
    background: linear-gradient(135deg, #fef8f0, #f8fafc);
}

.user-access-table th {
    padding: 18px 20px;
    text-align: left;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 3px solid #e2e8f0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-access-table td {
    padding: 18px 20px;
    border-bottom: 1px solid #f1f5f9;
    color: #64748b;
    font-size: 14px;
}

.user-access-table tbody tr {
    transition: all 0.2s ease;
}

.user-access-table tbody tr:hover {
    background: linear-gradient(135deg, #fffbf5, #fafbfc);
    box-shadow: inset 0 0 0 2px #f0e6d6;
}

.plan-access-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #d4a574;
    transition: transform 0.2s ease;
}

.plan-access-checkbox:hover {
    transform: scale(1.1);
}

.empty-state {
    text-align: center;
    padding: 80px 40px;
    color: #94a3b8;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.empty-state i {
    font-size: 5rem;
    margin-bottom: 24px;
    opacity: 0.4;
    color: #d4a574;
}

.empty-state h3 {
    font-size: 1.75rem;
    color: #64748b;
    margin-bottom: 12px;
    font-weight: 700;
}

.empty-state p {
    color: #94a3b8;
    font-size: 1rem;
}

.empty-message {
    text-align: center;
    padding: 60px 40px;
    color: #94a3b8;
    font-style: italic;
    background: linear-gradient(135deg, #fef8f0, #f8fafc);
    border-radius: 16px;
    border: 2px dashed #e2e8f0;
}

/* Modal Styles */
.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.modal-body {
    padding: 24px 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #d4a574;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-text {
    display: block;
    margin-top: 4px;
    font-size: 0.875rem;
    color: #94a3b8;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

/* User Access Settings Modal */
.user-access-settings {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.user-access-settings h3 {
    font-size: 1.25rem;
    color: #1e293b;
    margin: 0 0 24px 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-access-settings h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #d4a574, #c49464);
    border-radius: 2px;
}

.plan-access-item {
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    background: linear-gradient(135deg, #fefefe, #fafbfc);
    transition: all 0.3s ease;
}

.plan-access-item:hover {
    border-color: #d4a574;
    box-shadow: 0 4px 16px rgba(212, 165, 116, 0.15);
}

.plan-access-header {
    margin-bottom: 0;
}

.plan-access-header label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    padding: 8px 0;
}

.plan-access-header input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: #d4a574;
    transition: transform 0.2s ease;
}

.plan-access-header input[type="checkbox"]:hover {
    transform: scale(1.1);
}

.plan-access-pricing {
    margin-top: 16px;
    padding-top: 20px;
    border-top: 2px solid #f1f5f9;
    animation: slideDown 0.3s ease;
}

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

.plan-access-pricing .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.plan-access-pricing .form-group {
    margin: 0;
}

.plan-access-pricing label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.plan-access-pricing input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.plan-access-pricing input:focus {
    outline: none;
    border-color: #d4a574;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.plan-access-pricing input::placeholder {
    color: #94a3b8;
    font-style: italic;
}

/* Stripe Section in Modal */
.stripe-section {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px solid #0ea5e9;
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
}

.stripe-section h3 {
    font-size: 1.25rem;
    color: #0c4a6e;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stripe-section h3 i {
    color: #635bff;
    font-size: 1.5rem;
}

.stripe-section .help-text {
    background: white;
    border-left: 4px solid #0ea5e9;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 8px;
    color: #0c4a6e;
    font-size: 14px;
    line-height: 1.6;
}

.stripe-section .help-text i {
    color: #0ea5e9;
    margin-right: 8px;
}

.stripe-section .help-text a {
    color: #635bff;
    font-weight: 600;
    text-decoration: none;
}

.stripe-section .help-text a:hover {
    text-decoration: underline;
}

/* Override Modal Styles for Subscription Plans */
/* These styles are now handled by modal.js but kept for fallback */

/* Modal Form Styles */
.modal-header {
    padding: 24px 30px;
    border-bottom: 2px solid #f1f5f9;
    background: linear-gradient(135deg, #fef8f0, #ffffff);
    flex-shrink: 0;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

.modal-header h2 i {
    color: #d4a574;
    font-size: 1.5rem;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #fafbfc;
    flex-shrink: 0;
    position: relative;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #475569;
    font-size: 14px;
}

.form-group label input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #d4a574;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #d4a574;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.form-control::placeholder {
    color: #94a3b8;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}

/* ==========================================================================
   RESPONSIVE DESIGN - MOBILE OPTIMIZATION
   ========================================================================== */

/* Tablets and smaller */
@media (max-width: 768px) {
    .plans-admin-container {
        padding: 20px 15px;
        border-radius: 0;
    }

    .plans-admin-header {
        padding: 20px;
    }

    .plans-admin-header h1 {
        font-size: 1.5rem;
    }

    .organization-selector {
        padding: 16px;
    }

    .plans-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .plan-card {
        min-width: auto;
    }

    /* Modal adjustments for tablets */
    .plans-admin-container .modal {
        max-width: 95% !important;
        max-height: 95vh !important;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 16px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .user-access-table {
        font-size: 13px;
    }

    .user-access-table th,
    .user-access-table td {
        padding: 12px 10px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .plans-admin-container {
        padding: 15px 10px;
    }

    .plans-admin-header {
        padding: 16px;
    }

    .plans-admin-header h1 {
        font-size: 1.25rem;
    }

    .plans-admin-header h1 i {
        font-size: 1.25rem;
    }

    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .btn i {
        font-size: 14px;
    }

    /* Full screen modals on mobile */
    .plans-admin-container .modal-overlay {
        padding: 0 !important;
    }

    .plans-admin-container .modal {
        max-width: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        height: 100vh;
    }

    .modal-header {
        padding: 16px;
        position: sticky;
        top: 0;
        z-index: 10;
        background: white;
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }

    .modal-header h2 i {
        font-size: 1.1rem;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
        position: sticky;
        bottom: 0;
        z-index: 10;
        background: white;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }

    .modal-footer .btn {
        flex: 1;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-control {
        padding: 10px 14px;
        font-size: 14px;
    }

    .stripe-section {
        padding: 16px;
        margin: 16px 0;
    }

    .stripe-section h3 {
        font-size: 1.1rem;
    }

    .stripe-section .help-text {
        font-size: 13px;
        padding: 10px 12px;
    }

    .plan-access-item {
        padding: 16px;
    }

    .plan-access-header label {
        font-size: 1rem;
    }

    .user-access-section {
        padding: 20px 16px;
    }

    .user-access-table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
    }

    .user-access-table th,
    .user-access-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }

    /* Stack buttons vertically on very small screens */
    .plan-actions {
        flex-direction: column;
    }

    .plan-actions .btn {
        width: 100%;
    }
}

/* ==========================================================================
   Планове - новият вид (07.10.2026): таблица вместо големи карти, в картата на таблото
   ========================================================================== */
#subscription-plans-admin .plans-admin-container { background: none; padding: 0; min-height: 0; border-radius: 0; max-width: none; }
#subscription-plans-admin .admin-header { padding: 0 0 16px; margin-bottom: 16px; background: none; box-shadow: none; border-radius: 0; align-items: center; gap: 12px; flex-wrap: wrap; }
#subscription-plans-admin .admin-header > div { gap: 4px; flex: 1; min-width: 0; }
#subscription-plans-admin .admin-header h1 { font-size: 1.35rem; font-weight: 800; color: #2b231d; gap: 10px; }
#subscription-plans-admin .admin-header h1 i { font-size: 1.2rem; }
#subscription-plans-admin .admin-header .subtitle { color: #8a7866; font-weight: 500; margin: 0; }
#subscription-plans-admin .admin-header .btn-primary { background: #3a2f26; box-shadow: none; border-radius: 11px; }
#subscription-plans-admin .admin-header .btn-primary:hover { background: #2b231d; box-shadow: none; transform: none; }
#subscription-plans-admin .plans-grid { display: block; margin: 0 0 8px; }
#subscription-plans-admin .user-access-section { margin-top: 28px; padding: 18px; border-radius: 16px; box-shadow: none; border: 1px solid #efe4d8; }
#subscription-plans-admin .user-access-section h2 { font-size: 1.1rem; margin-bottom: 12px; }
#subscription-plans-admin .user-access-section h2 i { font-size: 1.1rem; }

.pl-table { border: 1px solid #efe4d8; border-radius: 16px; overflow: hidden; background: #fff; }
.pl-row { display: grid; grid-template-columns: minmax(0, 2.4fr) 1fr 1fr 1fr 170px; gap: 12px; align-items: center; padding: 14px 16px; border-top: 1px solid #efe4d8; }
.pl-row.is-off { opacity: .6; }
.pl-head { background: #fbf4ec; border-top: 0; padding: 10px 16px; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #8a7866; }
.pl-name { min-width: 0; display: grid; gap: 3px; }
.pl-name b { font-size: 1rem; color: #2b231d; overflow-wrap: anywhere; }
.pl-name small { color: #8a7866; font-size: .82rem; line-height: 1.4; }
.pl-feats { color: #5a4a3a !important; }
.pl-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.pl-badges:empty { display: none; }
.pl-b { font-style: normal; display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: .74rem; font-weight: 800; background: #f3e6d6; color: #a8743f; white-space: nowrap; }
.pl-b--dk { background: #3a2f26; color: #f1d3a6; }
.pl-b--ok { background: #e7f4e8; color: #2f7a35; }
.pl-b--warn { background: #fdf1dc; color: #9a5d0b; }
.pl-price { display: grid; gap: 1px; font-size: .95rem; }
.pl-price b { color: #2b231d; }
.pl-price small { color: #2f7a35; font-weight: 800; font-size: .74rem; }
.pl-acts { display: flex; gap: 6px; }
.pl-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid #e6d4bf; background: #fff; color: #2b231d; font: inherit; font-weight: 700; font-size: .84rem; cursor: pointer; }
.pl-btn i { color: #a8743f; }
.pl-btn:hover { background: #fbf4ec; }
.pl-btn--dng, .pl-btn--dng i { color: #b3261e; }

@media (max-width: 767px) {
    .pl-head { display: none; }
    .pl-row { grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 14px; }
    .pl-name { grid-column: 1 / -1; }
    .pl-price::before, .pl-stripe::before { content: attr(data-l); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #8a7866; display: block; margin-bottom: 2px; }
    .pl-stripe { grid-column: 1 / -1; }
    .pl-stripe::before { display: none; }
    .pl-acts { grid-column: 1 / -1; }
    .pl-acts .pl-btn { min-height: 44px; flex: 1; justify-content: center; }
    .pl-acts .pl-btn--dng { flex: 0 0 52px; }
    #subscription-plans-admin .admin-header .btn-primary { width: 100%; justify-content: center; min-height: 44px; }
}
