/* Base Portal Styles */
.dashboard-content {
    padding: 0;
}

/* Brand Gradient Card Header */
.card-header-gradient {
    background: linear-gradient(135deg, #652583 0%, #a373bc 100%);
    color: white;
    border-bottom: none;
}

.card-header-gradient h5 {
    color: white;
}

/* Remove underline from links on hover (except navbar dropdown) */
a:not(.navbar .dropdown-toggle):hover {
    text-decoration: none !important;
}

/* Keep normal link behavior in cards and content */
.card a:hover,
.dashboard-card a:hover,
.table a:hover,
.modal-body a:hover {
    text-decoration: none !important;
}

/* ============================================
   Global Modal Styling - Unified Border Radius
   ============================================ */
.modal-content {
    border-radius: 12px !important;
    overflow: hidden;
}

/* Modal Backdrop - Blur Effect */
.modal-backdrop {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-backdrop.show {
    opacity: 0.6;
}

/* Quick Action Buttons - Equal width on desktop, square on mobile */
.quick-action-buttons .quick-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-weight: 500;
}

.quick-action-buttons .quick-action-btn i {
    font-size: 1.125rem;
}

/* Pending-termination guidance collapsed by default — the full text ran 6 lines on a phone. */
.pending-termination-help > summary {
    cursor: pointer;
    font-weight: 600;
    margin-top: 4px;
}

/* Service-detail card headers (Network Configuration, Contract History) put a title, up to
   two status badges and a 3-button group on ONE flex row. At 412px that overflowed the card
   and wrapped "Network Config" inside its own button. Stack them on phones instead. */
@media (max-width: 575.98px) {
    #serviceDetailsContent .card-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    #serviceDetailsContent .card-header > h6 {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
    }

    #serviceDetailsContent .card-header .btn-group {
        width: 100%;
    }

    #serviceDetailsContent .card-header .btn-group .btn {
        flex: 1 1 0;
        min-width: 0;
        min-height: 44px;
        white-space: nowrap;
        font-size: 0.75rem;
        padding: 0.45rem 0.35rem;
    }

    /* Drop the glyphs here: the label is the affordance, and the icon was stealing
       enough width to clip "Network Config". */
    #serviceDetailsContent .card-header .btn-group .btn i {
        display: none;
    }

    /* Wide tables scroll rather than clip; make that discoverable. */
    #serviceDetailsContent .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}

/* The sheet header and the Actions toggle exist in sheet mode only — narrow OR short.
   A landscape phone (717x412) is wide enough to dodge a width-only rule but gave the
   modal body just 35% of the viewport, which is the same failure as a narrow screen. */
.quick-actions-sheet-header { display: none; }
@media (min-width: 576px) and (min-height: 601px) {
    #serviceActionsToggle { display: none !important; }
}

/* Sheet mode: the actions become a full-screen sheet behind an Actions button, so the modal
   footer stays two buttons tall. The dialog is modal-dialog-scrollable — a tall footer
   steals the body's height directly, which squeezed the service details into a sliver. */
@media (max-width: 575.98px), (max-height: 600px) {
    #serviceQuickActions {
        position: fixed;
        inset: 0;
        z-index: 1060;
        display: none;
        margin: 0 !important;
        padding: 16px;
        background: #fff;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    #serviceQuickActions.is-open { display: block; }

    .quick-actions-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 16px;
        padding-bottom: 12px;
        border-bottom: 1px solid #dee2e6;
    }

    .quick-actions-sheet-title {
        font-size: 1.125rem;
        font-weight: 600;
    }

    .quick-action-buttons {
        flex-direction: column !important;
        gap: 10px !important;
        width: 100%;
    }

    .quick-action-buttons .quick-action-btn {
        flex-direction: row;
        width: 100% !important;
        min-width: 100%;
        flex: 0 0 auto;
        height: auto;
        padding: 14px 16px;
        border-radius: 8px;
        gap: 8px;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: 0.9375rem;
    }

    .quick-action-buttons .quick-action-btn i {
        font-size: 1.125rem;
        line-height: 1;
        width: auto;
        height: auto;
    }

    .quick-action-buttons .quick-action-btn .btn-label {
        font-size: 0.9375rem;
        font-weight: 600;
        text-transform: none;
        letter-spacing: 0;
        line-height: 1;
        margin: 0;
        padding: 0;
    }

    .quick-action-buttons .quick-action-btn .btn-label.d-sm-none {
        display: inline !important;
    }

    .quick-action-buttons .quick-action-btn .btn-label.d-none {
        display: none !important;
    }
}

/* Tablet and up: Show labels */
@media (min-width: 576px) {
    .quick-action-buttons .quick-action-btn .btn-label {
        display: inline;
    }
}

/* Small tablets (576-991px): Compact buttons and wider modals */
@media (min-width: 576px) and (max-width: 991.98px) {
    .quick-action-buttons .quick-action-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
        gap: 0.25rem;
    }
    .quick-action-buttons .quick-action-btn i {
        font-size: 0.875rem;
    }
    /* Make modals wider on tablets (except welcome modal which is fullscreen) */
    .modal:not(.welcome-modal) .modal-dialog {
        max-width: 90% !important;
        margin: 1rem auto;
    }
    /* Mobile-friendly pagination */
    .pagination {
        gap: 0.25rem;
        flex-wrap: wrap;
        justify-content: center !important;
    }
    .pagination .page-link {
        min-width: 36px;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.25rem 0.5rem;
        font-size: 0.8125rem;
        border-radius: 6px !important;
    }
}

/* Mobile: Full screen modals with touch-friendly enhancements */
@media (max-width: 767px) {
    .modal-content {
        border-radius: 0 !important;
    }

    /* Touch-friendly form controls in modals */
    .modal .form-control,
    .modal .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 0.625rem 0.875rem;
    }

    /* Better modal body padding */
    .modal-body {
        padding: 1rem;
    }

    /* Touch-friendly checkbox/radio in modals */
    .modal .form-check-input {
        width: 1.25em;
        height: 1.25em;
    }

    /* Modal footer buttons - touch-friendly sizing */
    .modal-footer {
        padding: 0.75rem;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        min-height: 44px;
        padding: 0.5rem 1rem;
        font-size: 0.9375rem;
    }
}

/* Stack modal buttons on very small screens */
@media (max-width: 400px) {
    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* Dashboard Card Hover Effects */
.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

/* Equal height cards only for dashboard invoice/payment sections */
#invoices-section .dashboard-card,
#payments-section .dashboard-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#invoices-section .dashboard-card .table-responsive,
#payments-section .dashboard-card .table-responsive {
    flex: 1;
}

#invoices-section .dashboard-card h4,
#payments-section .dashboard-card h4 {
    flex-shrink: 0;
}

.dashboard-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(101, 37, 131,0.05), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

.dashboard-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 30px rgba(101, 37, 131,0.2);
}

.dashboard-card:hover:before {
    left: 100%;
}

.stat-card {
    text-align: center;
    padding: 30px 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.stat-label {
    color: #666;
    margin-top: 10px;
}

.balance-negative {
    color: #dc3545;
}

.balance-positive {
    color: #28a745;
}

/* Welcome Section */
.welcome-section {
    padding: 20px 0;
}

.welcome-section h2 {
    color: #333;
    font-weight: 600;
}

.welcome-section .lead {
    font-size: 1.1rem;
}

/* Dashboard Tips Section */
.tips-section {
    margin-bottom: 20px;
}

.tips-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(101, 37, 131, 0.1);
    border: 1px solid rgba(101, 37, 131, 0.2);
    transition: all 0.4s ease;
    cursor: pointer;
}

.tips-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #c3cfe2 0%, #f5f7fa 100%);
}

.tips-header {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--brand-purple-light) 100%);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.tips-icon {
    font-size: 28px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.tips-title {
    margin: 0;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.tips-body {
    padding: 25px;
    background: linear-gradient(to bottom, #f8f9ff, white);
}

.tip-title {
    color: var(--bs-primary);
    font-weight: bold;
    margin-bottom: 12px;
    font-size: 17px;
}

.tip-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.tip-hint {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px 15px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tip-hint i {
    color: #ffc107;
}

.hint-text {
    color: #856404;
    font-size: 14px;
}

.tips-footer {
    background: #f8f9fa;
    padding: 10px 20px;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

/* ============================================
   Promotions Banner - Bold Marketing Style
   ============================================ */
.promo-banner {
    display: flex;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(101, 37, 131, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.promo-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(101, 37, 131, 0.2);
    color: inherit;
    text-decoration: none;
}

.promo-banner-accent {
    background: linear-gradient(180deg, var(--bs-primary) 0%, #8b3fa8 100%);
    color: white;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 80px;
}

.promo-banner-icon {
    font-size: 1.5rem;
    animation: promo-icon-float 3s ease-in-out infinite;
}

@keyframes promo-icon-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.promo-banner-badge {
    background: #ffc107;
    color: #333;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.promo-banner-body {
    flex: 1;
    background: linear-gradient(135deg, #fffbf0 0%, #fff5e6 50%, #ffedd6 100%);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Subtle warm shine effect */
.promo-banner-body::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,200,100,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.promo-banner-title {
    font-weight: 800;
    font-size: 1.1rem;
    color: #1a1a2e;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 0 rgba(255,255,255,0.8);
}

.promo-banner-desc {
    font-size: 0.85rem;
    color: #4a4a5a;
    line-height: 1.4;
    margin-bottom: 10px;
}

.promo-banner-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.promo-banner-expires {
    font-size: 0.72rem;
    color: #d35400;
    font-weight: 700;
    background: rgba(211, 84, 0, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
}

.promo-banner-expires i {
    margin-right: 4px;
}

.promo-banner-cta {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--bs-primary) 0%, #8b3fa8 100%);
    padding: 6px 14px;
    border-radius: 20px;
    white-space: nowrap;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    box-shadow: 0 2px 8px rgba(101, 37, 131, 0.3);
}

.promo-banner-cta i {
    margin-left: 6px;
    transition: transform 0.2s ease;
}

.promo-banner:hover .promo-banner-cta {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(101, 37, 131, 0.4);
}

.promo-banner:hover .promo-banner-cta i {
    transform: translateX(4px);
}

/* Mobile: Stack promo banner */
@media (max-width: 575.98px) {
    .promo-banner {
        flex-direction: column;
    }

    .promo-banner-accent {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 10px 14px;
        min-width: auto;
        gap: 10px;
    }

    .promo-banner-icon {
        font-size: 1.2rem;
        animation: none; /* Disable float animation on mobile for performance */
    }

    .promo-banner-badge {
        margin: 0;
    }

    .promo-banner-body {
        padding: 12px 14px;
    }

    .promo-banner-title {
        font-size: 0.9rem;
    }

    .promo-banner-desc {
        font-size: 0.78rem;
    }

    .promo-banner-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .promo-banner-cta {
        font-size: 0.75rem;
        text-align: center;
        padding: 8px 16px;
    }
}

/* Loading States */
.loading-spinner {
    text-align: center;
    padding: 20px;
    color: var(--bs-primary);
}

/* Quick Actions */
.quick-actions {
    margin-top: 20px;
}

.quick-actions .btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Responsive Tables */
.table-responsive {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    display: block;
}

.table-responsive table {
    width: 100%;
    margin-bottom: 0;
}

/* Disable ALL transform effects inside tables to prevent scrollbar */
.table tbody tr,
.table-responsive tbody tr,
.invoice-row,
.payment-row,
.clickable-row {
    transform: none !important;
}

.table tbody tr:hover,
.table-responsive tbody tr:hover,
.invoice-row:hover,
.payment-row:hover,
.clickable-row:hover {
    transform: none !important;
}

/* Disable button ripple and transform effects inside tables */
.table .btn:before,
.table-responsive .btn:before,
.card .table .btn:before {
    display: none !important;
}

.table .btn:hover,
.table-responsive .btn:hover,
.card .table .btn:hover {
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.85;
}

.table .btn-sm:hover,
.table-responsive .btn-sm:hover {
    transform: none !important;
}

/* Portal table action buttons - equal sizing (icon-only buttons) */
#servicesTable .btn-sm,
#servicesTableBody .btn-sm,
#customersTable .btn-sm,
#customersTableBody .btn-sm,
#invoicesTableBody .btn-sm,
#paymentsTableBody .btn-sm,
#ticketsTableBody .btn-sm,
#serviceRequestsTableBody .btn-sm,
#commissionsTableBody .btn-sm,
#byofTableBody .btn-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Hide action buttons on small tablets (576-991px) - row click opens modal */
@media (min-width: 576px) and (max-width: 991.98px) {
    #servicesTableBody .btn-sm,
    #customersTableBody .btn-sm {
        display: none !important;
    }
    /* Hide Actions column header too */
    #servicesTable th:last-child,
    #customersTable th:last-child {
        display: none !important;
    }
}

/* Prevent Bootstrap card flex stretching - CRITICAL for whitespace fix */
.card {
    display: block !important;
    height: auto !important;
    border-radius: 0.75rem !important; /* 12px - consistent rounded corners */
    overflow: hidden !important; /* Clip content to show rounded corners */
}

/* Allow d-none to work on cards */
.card.d-none {
    display: none !important;
}

.card-body {
    display: block !important;
    height: auto !important;
}

.card-body > .table-responsive {
    height: auto !important;
    flex: none !important;
}

/* Status Badges */
.badge {
    padding: 0.5em;
    font-size: 0.875em;
    font-weight: 600;
    min-width: 2em;
    min-height: 2em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
}

/* AJAX Content Animation */
.ajax-content {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Error States */
.error-message {
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    border-radius: 5px;
}

/* Module Transitions */
.module-content {
    transition: opacity 0.2s ease-in-out;
}

.module-loading {
    opacity: 0.5;
}

/* Stats Cards Special Effects */
.stats-card {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--brand-purple-light) 100%);
    color: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.stats-card:hover {
    transform: translateY(-8px) rotate(-1deg);
    box-shadow: 0 15px 40px rgba(101, 37, 131,0.3);
}

.stats-card .stat-icon {
    transition: all 0.4s ease;
}

.stats-card:hover .stat-icon {
    transform: scale(1.3) rotate(15deg);
}

/* Bounce Animation for Icons */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Button Hover Effects */
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover:before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* OVERRIDE: Disable button effects inside table structures */
.table .btn,
.table-responsive .btn,
.card .btn {
    overflow: visible;
}

/* Section Loading Animation */
#welcome-section, #stats-section, #contracts-section,
#invoices-section, #payments-section, #tips-section, #promotions-section {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Ticket row styles */
.ticket-row {
    transition: all 0.3s ease;
}

.ticket-row:hover {
    background: rgba(23, 162, 184, 0.05);
}

/* Welcome Card Styles */
.welcome-card {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--brand-purple-light) 100%);
    color: white;
    border: none;
}

.welcome-card .text-muted {
    color: rgba(255,255,255,0.8) !important;
}

.welcome-icon {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.welcome-message {
    background: rgba(255,255,255,0.95);
    color: #333;
}

.welcome-message .text-muted {
    color: #6c757d !important;
}

.welcome-message strong {
    font-size: 1.05rem;
}

@media (max-width: 576px) {
    .welcome-card h3 {
        font-size: 1.25rem;
    }

    .welcome-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .welcome-message .fa-2x {
        font-size: 1.5rem;
    }
}

/* Utility Classes */
.cursor-pointer {
    cursor: pointer;
}

.cursor-help {
    cursor: help;
}

.text-lg {
    font-size: 1.25rem;
}

.text-xl {
    font-size: 1.15rem;
}

.text-nowrap {
    white-space: nowrap;
}

.opacity-70 {
    opacity: 0.7;
}

/* Spinner Sizes */
.spinner-lg {
    width: 3rem;
    height: 3rem;
}

/* Amount Display */
.amount-large {
    font-size: 1.25rem;
}

/* Transaction ID Styling */
.transaction-id {
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.6;
}

.transaction-id-mobile {
    font-family: 'Courier New', monospace;
    font-size: 0.75em;
}

.copy-icon {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.9em;
    opacity: 0.5;
    vertical-align: middle;
}

/* Table Column Widths */
.col-w-10 { width: 10%; }
.col-w-15 { width: 15%; }
.col-w-20 { width: 20%; }
.col-w-35 { width: 35%; }

.text-info-custom {
    color: #17a2b8;
}

.text-strikethrough {
    text-decoration: line-through;
}

.icon-lg {
    font-size: 1.3em;
}

/* Table Column Spacing - Universal for ALL tables */
.table th,
.table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    line-height: 1.6;
    height: 3.5rem;
    overflow: visible;
}

/* Payment Table Styles */
.payment-row {
    transition: all 0.3s ease;
}

.payment-row:hover {
    background: linear-gradient(90deg, rgba(40,167,69,0.05) 0%, rgba(40,167,69,0.02) 100%);
}

.clickable-row {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-row:hover {
    background: rgba(101, 37, 131,0.05);
}

.payment-amount-mobile {
    font-size: 1.15rem;
}

/* Mobile card styles */
.payment-card {
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.service-card {
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

@media (max-width: 767px) {
    .payment-card,
    .service-card {
        border-left: 3px solid var(--bs-primary);
    }
}

/* Invoices Page Styles */
.invoice-row {
    position: relative;
}

.invoice-row:hover {
    background: linear-gradient(90deg, rgba(101, 37, 131,0.05) 0%, rgba(163, 115, 188,0.03) 100%);
}

.invoice-row td {
    vertical-align: middle;
}

.invoice-row .btn,
.invoice-row .btn-sm {
    transition: opacity 0.2s ease;
}

.invoice-row .btn:hover,
.invoice-row .btn-sm:hover {
    opacity: 0.8;
    transform: none !important;
    box-shadow: none !important;
}

.invoice-card {
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.invoice-card:active {
    transform: scale(0.98);
    background: rgba(101, 37, 131,0.03);
}

@media (max-width: 767px) {
    .invoice-card .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
        min-height: 40px; /* Touch-friendly target size */
    }

    .invoice-card .btn-group .btn {
        padding: 0.5rem 0.625rem; /* Slightly tighter for grouped buttons */
    }
}

/* Payments Page Styles */
.payment-method-card {
    transition: all 0.3s ease;
    margin-bottom: 20px;
    height: 100%;
}

.payment-method-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}

.payment-method-card i {
    transition: all 0.3s ease;
}

.payment-method-card:hover i {
    transform: scale(1.1);
}

/* Payment Info Cards - Equal Height */
.payment-info-card {
    display: flex;
    flex-direction: column;
}

.payment-info-card-preferred {
    background: linear-gradient(135deg, #e7f3ff 0%, #f0f8ff 100%);
}

.bank-details {
    font-size: 0.95rem;
}

.bank-details .row {
    align-items: center;
}

.copy-btn {
    padding: 6px 12px;
    font-size: 0.8125rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 767px) {
    .copy-btn {
        padding: 8px 14px;
        min-width: 44px;
        min-height: 44px; /* Touch-friendly minimum */
    }
}

.copy-btn:hover {
    transform: scale(1.05);
}

.copy-btn:active {
    transform: scale(0.95);
    background-color: rgba(101, 37, 131, 0.15);
}

.copy-btn.copied {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

/* Profile Page Styles */
.security-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.security-item:last-child {
    border-bottom: none;
}

.security-item i {
    margin-right: 10px;
    font-size: 1.2em;
}

.form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(101, 37, 131, 0.25);
}

.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Services Page Styles */
.page-title {
    font-weight: 300;
    color: #333;
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.btn-check:checked + .btn {
    font-weight: 600;
}

/* Focus styles for accessibility - visible ring for keyboard navigation */
.btn-check:focus + .btn,
.btn:focus {
    outline: none;
    box-shadow: none;
}

/* Restore visible focus for keyboard navigation (focus-visible) */
.btn-check:focus-visible + .btn,
.btn:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    box-shadow: none;
}

/* Remove focus ring specifically for filter buttons which have visual state */
.card-header .btn-check:focus-visible + .btn {
    outline: none;
}

/* Disable ripple effect for filter buttons in card headers */
.card-header .btn:before {
    display: none !important;
}

.card-header .btn:hover {
    transform: none !important;
}

.card-header {
    border-bottom: 2px solid #e9ecef !important;
}

.service-card {
    transition: all 0.3s ease;
}

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

/* Mobile service card enhancements */
@media (max-width: 575.98px) {
    .service-card {
        padding: 1rem !important;
        border-radius: 12px !important;
    }

    .service-card .btn {
        min-height: 44px;
        font-size: 0.9375rem;
        border-radius: 8px;
    }

    .service-card .btn-sm {
        min-height: 40px;
        padding: 0.5rem 1rem;
    }

    .service-card:active {
        transform: scale(0.98);
        background: rgba(101, 37, 131, 0.02);
    }

    /* Better spacing for mobile card content */
    .service-card .d-flex {
        gap: 0.5rem;
    }
}

#searchInput {
    transition: all 0.3s ease;
}

#searchInput:focus {
    box-shadow: 0 0 0 0.25rem rgba(101, 37, 131, 0.25);
}

/* Support Page Styles - UPDATED */
.support-card {
    height: 100%;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 20px;
}

.support-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.support-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
}

.support-card i.fa-3x {
    transition: all 0.3s ease;
}

.support-card:hover i.fa-3x {
    transform: scale(1.1);
}

.d-grid.gap-2 {
    margin-top: auto;
}

/* Modern FAQ Section Styling */
.faq-section {
    border-radius: 16px !important;
    overflow: hidden;
}

.faq-section .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.5rem;
}

/* FAQ Search and Filter Styling */
#faq-search {
    border-left: none;
    font-size: 0.95rem;
}

#faq-search:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(101, 37, 131, 0.15);
}

.input-group-text {
    border-right: none;
}

#faq-category-filter {
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    background-color: #fff;
    font-weight: 500;
    padding: 0.625rem 2.5rem 0.625rem 0.75rem;
}

#faq-category-filter option {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

#faq-category-filter:hover {
    border-color: var(--bs-primary);
    background-color: #f8f9fa;
}

#faq-category-filter:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(101, 37, 131, 0.15);
}

#clear-search {
    transition: all 0.2s ease;
}

#clear-search:hover {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

#active-filter-badge {
    animation: slideDown 0.3s ease;
}

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

#active-filter-badge .badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(101, 37, 131, 0.3);
    cursor: default;
}

#active-filter-badge .badge:hover {
    background-color: #5568d3 !important;
    box-shadow: 0 4px 12px rgba(101, 37, 131, 0.4);
    transform: translateY(-1px);
}

#active-filter-badge .btn-close {
    cursor: pointer;
}

#active-filter-badge .btn-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.faq-item {
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08) !important;
}

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

.faq-item.hidden {
    display: none;
}

.accordion-button {
    background: transparent;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 1.25rem 1.5rem;
    font-size: 1rem;
    border: none !important;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.accordion-button:hover {
    background-color: rgba(101, 37, 131, 0.05);
}

.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, rgba(101, 37, 131, 0.12) 0%, rgba(163, 115, 188, 0.08) 100%);
    color: var(--bs-primary);
    font-weight: 600;
}

.accordion-button:focus {
    border-color: transparent !important;
    box-shadow: 0 0 0 0.2rem rgba(101, 37, 131, 0.15);
}

.accordion-button::after {
    transition: all 0.3s ease;
}

.accordion-body {
    padding: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #495057;
}

.accordion-button .badge {
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
    margin-right: 0;
}

.accordion-item {
    margin-bottom: 10px;
}

/* Mobile optimizations for FAQ accordion */
@media (max-width: 768px) {
    .accordion-button {
        padding: 1rem;
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .accordion-button .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    .accordion-body {
        padding: 1rem;
        font-size: 0.9rem;
    }
}

/* Dashboard Stats Snippet */
.clickable-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}

.clickable-card:active {
    transform: translateY(-2px) scale(1.01);
}

/* Mobile optimizations for support page */
@media (max-width: 768px) {
    .support-card .card-body {
        min-height: auto;
    }

    #active-filter-badge {
        text-align: center;
    }
}

/* Transaction ID Responsive Styles */
.transaction-id-cell {
    white-space: nowrap;
}

.transaction-id {
    display: inline-block;
    max-width: 100%;
}

/* Allow wrapping on smaller screens */
@media (max-width: 992px) {
    .transaction-id-cell {
        white-space: normal;
        word-break: break-all;
    }

    .transaction-id {
        font-size: 0.75em !important;
        line-height: 1.4;
    }
}

/* Services Filter Header - Redesigned for mobile */
.services-filter-header {
    padding: 1rem;
}

.status-icon-badges-wrapper {
    margin-bottom: 0.875rem;
}

.search-input-wrapper {
    max-width: 100%;
}

.search-input-wrapper .input-group {
    border-radius: 8px;
    overflow: hidden;
}

.search-input-wrapper .input-group-text {
    border: 1px solid #dee2e6;
    border-right: none;
}

.search-input-wrapper .form-control {
    border: 1px solid #dee2e6;
    border-left: none;
    min-height: 44px;
    font-size: 1rem;
}

.search-input-wrapper .form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(101, 37, 131, 0.15);
}

.search-input-wrapper .form-control:focus + .input-group-text,
.search-input-wrapper .input-group:focus-within .input-group-text {
    border-color: var(--bs-primary);
}

/* Services Filter Badges */
.status-icon-badges {
    padding: 0;
}

.icon-badge {
    cursor: pointer;
    padding: 0.625rem 0.875rem;
    border-radius: 10px;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 1px solid #e9ecef;
}

.icon-badge i {
    font-size: 1.125rem;
}

.icon-badge .badge-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #495057;
}

.icon-badge:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    transform: translateY(-1px);
}

.icon-badge:active {
    transform: scale(0.97);
}

.icon-badge.active {
    background: linear-gradient(135deg, rgba(101, 37, 131, 0.1) 0%, rgba(102, 126, 234, 0.1) 100%);
    border-color: var(--bs-primary);
    box-shadow: 0 2px 8px rgba(101, 37, 131, 0.15);
}

.icon-badge.active .badge-label {
    color: var(--bs-primary);
}

.icon-badge .count-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
}

.text-orange {
    color: #fd7e14 !important;
}

.bg-orange {
    background-color: #fd7e14 !important;
}

/* Hide icon badges with 0 count (except All) */
.icon-badge[data-status]:not([data-status="all"]).zero-count {
    display: none !important;
}

/* Tablet and up: horizontal layout */
@media (min-width: 576px) {
    .services-filter-header {
        padding: 1rem 1.25rem;
    }

    .search-input-wrapper {
        max-width: 320px;
    }
}

/* Mobile: Optimized compact layout with visible labels */
@media (max-width: 575.98px) {
    /* Filter header minimal padding */
    .card-header.services-filter-header,
    .services-filter-header {
        padding: 0.5rem 2px !important;
    }

    .status-icon-badges-wrapper {
        margin-bottom: 0.625rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 0 !important;
        margin: 0 0 0.625rem 0 !important;
    }

    .status-icon-badges-wrapper::-webkit-scrollbar {
        display: none;
    }

    .status-icon-badges {
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        padding-bottom: 0.25rem;
        gap: 0.5rem !important;
    }

    .icon-badge {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 68px;
        min-height: 62px;
        padding: 0.5rem 0.75rem;
        gap: 0.25rem;
        flex-shrink: 0;
        position: relative;
    }

    .icon-badge i {
        font-size: 1.375rem;
        margin-bottom: 0.125rem;
    }

    /* Show labels on mobile - this is critical for usability */
    .icon-badge .badge-label {
        display: block !important;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.01em;
        color: #6c757d;
        line-height: 1.2;
    }

    .icon-badge.active .badge-label {
        color: var(--bs-primary);
    }

    /* Count badge as overlay on top-right */
    .icon-badge .count-badge {
        position: absolute;
        top: 2px;
        right: 2px;
        font-size: 0.75rem;
        padding: 0.0625rem 0.3125rem;
        min-width: 16px;
        line-height: 1.4;
    }

    .search-input-wrapper {
        padding: 0 !important;
        margin: 0 !important;
    }

    .search-input-wrapper .form-control {
        font-size: 16px; /* Prevents iOS zoom */
    }
}

/* ============================================
   Select2 Dropdown Enhancement for Modals
   ============================================ */

/* Enhanced Select2 dropdown styling for better visual distinction from modal background */
.select2-container--bootstrap-5 .select2-dropdown {
    background-color: #f8f9fa !important;
    border: 2px solid #0d6efd !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border-radius: 0.375rem !important;
}

.select2-container--bootstrap-5 .select2-results__option {
    padding: 12px 16px !important;
    background-color: #ffffff !important;
    border-bottom: 1px solid #e9ecef !important;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: #e7f1ff !important;
    color: #0d6efd !important;
}

.select2-container--bootstrap-5 .select2-results__option--selected {
    background-color: #cfe2ff !important;
    color: #084298 !important;
}

.select2-container--bootstrap-5 .select2-search--dropdown {
    background-color: #f8f9fa !important;
    padding: 8px !important;
}

.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
}

/* Mobile: Enhanced Select2 dropdown touch targets (no fixed positioning - breaks in modals) */
@media (max-width: 575.98px) {
    /* Larger touch targets for options */
    .select2-container--bootstrap-5 .select2-results__option {
        padding: 14px 16px !important;
        min-height: 48px !important;
    }

    /* Larger search input - 16px prevents iOS zoom */
    .select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
        min-height: 44px !important;
        font-size: 16px !important;
        padding: 10px 12px !important;
    }

    /* Reasonable max-height for dropdown */
    .select2-container--bootstrap-5 .select2-results {
        max-height: 50vh !important;
        overflow-y: auto !important;
    }
}

/* ============================================
   Termination Confirmation Page Styles
   ============================================ */

/* Ensure page can scroll when content is taller than viewport */
html, body {
    height: auto !important;
    overflow-y: auto !important;
}

/* Smooth transitions for state changes */
#confirmLoadingState,
#confirmSuccessState,
#confirmErrorState {
    transition: opacity 0.3s ease-in-out;
}

/* Icon sizes for success/error states */
.icon-success,
.icon-error {
    font-size: 4rem;
}

/* Icon animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.icon-success,
.icon-error {
    animation: fadeInScale 0.5s ease-out;
}

/* ============================================
   Invoice View Modal Styles
   ============================================ */

@media print {
    /* Hide everything except invoice content */
    body * {
        visibility: hidden;
    }

    #invoiceViewModal,
    #invoiceViewModal * {
        visibility: visible;
    }

    #invoiceViewModal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    /* Hide modal chrome and notices when printing */
    #invoiceViewModal .modal-header,
    #invoiceViewModal .modal-footer,
    #invoiceViewModal .btn-close,
    #invoiceViewModal #invoiceHistoricalNotice {
        display: none !important;
    }

    #invoiceViewModal .modal-dialog {
        max-width: 100%;
        margin: 0;
    }

    #invoiceViewModal .modal-content {
        border: none;
        box-shadow: none;
    }

    #invoiceViewModal .modal-body {
        padding: 0 !important;
    }

    /* Invoice content full width */
    #invoiceContent {
        width: 100%;
        padding: 20px;
    }
}

/* Modal content styling */
#invoiceContent {
    min-height: 400px;
    background: #fff;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Force minimum width for invoice content to maintain desktop layout */
#invoiceContent > * {
    min-width: 900px;
}

#invoiceContent .invoice-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

/* Error state styling */
#invoiceContent .alert {
    margin: 2rem;
}

/* Loading state */
#invoiceLoading {
    padding: 3rem 1rem;
}

/* Historical document notice styling */
#invoiceHistoricalNotice {
    border-left: 4px solid #0dcaf0;
    background-color: #cff4fc;
    border-color: #b6effb;
    font-size: 0.9rem;
    line-height: 1.5;
}

#invoiceHistoricalNotice i {
    color: #087990;
    font-size: 1.1rem;
}

#invoiceHistoricalNotice strong {
    color: #055160;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Reduce padding but maintain min-width for horizontal scroll */
    #invoiceContent .invoice-container {
        padding: 1rem;
    }

    .modal-xl {
        margin: 0.5rem;
    }

    /* Make modal body scrollable on mobile */
    #invoiceViewModal .modal-body {
        padding: 0 !important;
    }

    #invoiceHistoricalNotice {
        font-size: 0.85rem;
        margin: 0.75rem !important;
    }

    #invoiceHistoricalNotice i {
        font-size: 1rem;
    }
}

/* ============================================
   Services Main Page Styles
   ============================================ */

/* Termination badge with gradient */
.termination-badge {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
}

/* ============================================
   Payment Statement Modal Styles
   ============================================ */

@media print {
    /* Hide everything except statement content */
    body * {
        visibility: hidden;
    }

    #statementViewModal,
    #statementViewModal * {
        visibility: visible;
    }

    #statementViewModal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    /* Hide modal chrome and notices when printing */
    #statementViewModal .modal-header,
    #statementViewModal .modal-footer,
    #statementViewModal .btn-close,
    #statementViewModal #statementTimestampNotice {
        display: none !important;
    }

    #statementViewModal .modal-dialog {
        max-width: 100%;
        margin: 0;
    }

    #statementViewModal .modal-content {
        border: none;
        box-shadow: none;
    }

    #statementViewModal .modal-body {
        padding: 0 !important;
    }

    /* Statement content full width */
    #statementContent {
        width: 100%;
        padding: 20px;
    }
}

/* Modal content styling */
#statementContent {
    min-height: 400px;
    background: #fff;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Force minimum width for statement content to maintain desktop layout */
#statementContent > * {
    min-width: 900px;
}

#statementContent .statement-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

/* Error state styling */
#statementError {
    margin: 2rem;
}

/* Loading state */
#statementLoading {
    padding: 3rem 1rem;
}

/* Statement timestamp notice styling */
#statementTimestampNotice {
    border-left: 4px solid #0dcaf0;
    background-color: #cff4fc;
    border-color: #b6effb;
    font-size: 0.9rem;
    line-height: 1.5;
}

#statementTimestampNotice i {
    color: #087990;
    font-size: 1.1rem;
}

#statementTimestampNotice strong {
    color: #055160;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #statementContent .statement-container {
        padding: 1rem;
    }

    .modal-xl {
        margin: 0.5rem;
    }

    #statementViewModal .modal-body {
        padding: 0 !important;
    }

    #statementTimestampNotice {
        font-size: 0.85rem;
        margin: 0.75rem !important;
    }

    #statementTimestampNotice i {
        font-size: 1rem;
    }
}

/* ============================================
   Change Plan Modal Styles
   ============================================ */

/* Change Plan Modal - Internal Scrolling */
#changePlanModal .modal-dialog-scrollable .modal-body {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Smooth scrolling */
#changePlanModal .modal-body {
    scroll-behavior: smooth;
}

/* Custom scrollbar styling */
#changePlanModal .modal-body::-webkit-scrollbar {
    width: 8px;
}

#changePlanModal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#changePlanModal .modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#changePlanModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Select2 - Tone down aggressive blue highlighting */
#changePlanModal .select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

#changePlanModal .select2-container--bootstrap-5 .select2-results__option--selected {
    background-color: #e9ecef !important;
    color: #212529 !important;
}

#changePlanModal .select2-container--bootstrap-5 .select2-results__option:hover {
    background-color: #f8f9fa !important;
}

/* Mobile responsive improvements */
@media (max-width: 576px) {
    #changePlanModal .modal-dialog {
        margin: 0.5rem;
    }

    #changePlanModal .modal-body {
        padding: 15px;
    }

    #changePlanModal .modal-header,
    #changePlanModal .modal-footer {
        padding: 12px 15px;
    }

    /* Stack form elements better on mobile */
    #changePlanModal .alert {
        font-size: 0.9rem;
        padding: 12px;
    }

    #changePlanModal .form-select {
        font-size: 0.95rem;
    }
}

/* Button styling improvements - equal sizes and better colors */
#changePlanModal .modal-footer .btn {
    min-width: 120px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#changePlanModal .modal-footer .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #ffffff;
}

#changePlanModal .modal-footer .btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#changePlanModal .modal-footer .btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    border: none;
    color: #000000;
    font-weight: 600;
}

#changePlanModal .modal-footer .btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, #ffb300 0%, #f57c00 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
}

#changePlanModal .modal-footer .btn-warning:disabled {
    background: #e0e0e0;
    color: #9e9e9e;
    cursor: not-allowed;
    opacity: 0.65;
}

/* Mobile button adjustments */
@media (max-width: 576px) {
    #changePlanModal .modal-footer {
        flex-direction: column;
        gap: 8px;
    }

    #changePlanModal .modal-footer .btn {
        width: 100%;
        min-width: unset;
    }
}

/* ============================================
   MAC Management Modal Styles
   ============================================ */
/* MAC Modal Styles */
#macManageModal .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

#macManageModal .alert {
    margin-bottom: 1rem;
}

#macManageModal .input-group-text {
    min-width: 150px;
}

#macManageModal #mac_new_mac {
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
}

#macManageModal #mac_current {
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

/* Auto-format MAC input */
#macManageModal #mac_new_mac::placeholder {
    text-transform: none;
}

/* ============================================
   Service Move Modal Styles (In Services)
   ============================================ */
/* Mobile-first: full screen modal on small devices */
@media (max-width: 575.98px) {
    #serviceMoveModal .modal-content {
        height: 100vh;
    }

    #serviceMoveModal .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Desktop: large modal with padding */
@media (min-width: 576px) {
    #serviceMoveModal .modal-xl {
        max-width: 900px;
    }
}

/* Survey styling inside modal */
#moveSurveyContainer .sd-root-modern,
#moveSurveyContainer .sd-body,
#moveSurveyContainer .sv_body {
    padding: 0 !important;
}

#moveSurveyContainer .sd-page,
#moveSurveyContainer .sv_page {
    padding: 20px 15px !important;
}

/* Smooth animations */
#serviceMoveModal.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
}

/* Loading state */
.move-loading {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.move-loading i {
    font-size: 3rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   Service View Modal Styles
   ============================================ */
/* Service modal styles */
#serviceViewModal .service-header {
    border-left: 4px solid #0d6efd;
}

#serviceViewModal .bg-gradient-light {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

#serviceViewModal .card {
    transition: transform 0.2s;
}

#serviceViewModal .card:hover {
    transform: translateY(-2px);
}

/* Print styles */
@media print {
    #serviceViewModal .modal-header,
    #serviceViewModal .modal-footer {
        display: none;
    }

    #serviceViewModal .modal-dialog {
        max-width: 100%;
        margin: 0;
    }
}

/* ============================================
   Terminate Service Modal Styles
   ============================================ */
/* Termination Modal Styles */
#terminateServiceModal .modal-dialog-scrollable .modal-body {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

#terminateServiceModal .modal-body {
    scroll-behavior: smooth;
}

#terminateServiceModal .modal-body::-webkit-scrollbar {
    width: 8px;
}

#terminateServiceModal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#terminateServiceModal .modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#terminateServiceModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Button styling */
#terminateServiceModal .modal-footer .btn {
    min-width: 120px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#terminateServiceModal .modal-footer .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

#terminateServiceModal .modal-footer .btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#terminateServiceModal .modal-footer .btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    font-weight: 600;
}

#terminateServiceModal .modal-footer .btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

#terminateServiceModal .modal-footer .btn-danger:disabled {
    background: #e0e0e0;
    color: #9e9e9e;
    cursor: not-allowed;
    opacity: 0.65;
}

/* Mobile responsive */
@media (max-width: 576px) {
    #terminateServiceModal .modal-dialog {
        margin: 0.5rem;
    }

    #terminateServiceModal .modal-body {
        padding: 15px;
    }

    #terminateServiceModal .modal-header,
    #terminateServiceModal .modal-footer {
        padding: 12px 15px;
    }

    #terminateServiceModal .modal-footer {
        flex-direction: column;
        gap: 8px;
    }

    #terminateServiceModal .modal-footer .btn {
        width: 100%;
        min-width: unset;
    }

    #terminateServiceModal .alert {
        font-size: 0.9rem;
        padding: 12px;
    }
}

/* ============================================
   Service Requests Page Styles
   ============================================ */
/* Building Covered badge styling */
.badge-covered {
    background-color: rgba(25, 135, 84, 0.1);
    color: #146c43;
    border: 1px solid rgba(25, 135, 84, 0.3);
}

/* ============================================
   Service Requests Survey Styles (New & Move)
   ============================================ */
/* Hidden class for survey results */
.hidden {
    display: none !important;
}

/* Portal-specific survey styling */
.service-request-survey-container,
.service-move-survey-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 0;
    margin-bottom: 20px;
    overflow: hidden; /* Ensure content respects rounded corners */
}

#surveyContainer {
    min-height: 400px;
}

/* Remove SurveyJS internal padding */
#surveyContainer .sd-root-modern,
#surveyContainer .sd-body,
#surveyContainer .sv_body {
    padding: 0 !important;
}

/* Survey pages - minimal side padding for full width */
#surveyContainer .sd-page,
#surveyContainer .sv_page {
    padding: 20px 0 !important;
}

/* Question rows - no horizontal padding/margins */
#surveyContainer .sd-row,
#surveyContainer .sv_row {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Questions get minimal padding for touch targets */
#surveyContainer .sd-question,
#surveyContainer .sv_q,
#surveyContainer .sv_qstn {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

/* Keep question titles visible (matching service request pattern) */

/* Success/Error states */
.survey-result-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 40px;
    text-align: center;
    margin: 40px auto;
    max-width: 600px;
}

.survey-result-card .success-icon {
    color: #28a745;
    font-size: 4rem;
    margin-bottom: 20px;
}

.survey-result-card .error-icon {
    color: #dc3545;
    font-size: 4rem;
    margin-bottom: 20px;
}

.survey-result-card h1 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #333;
}

.survey-result-card p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 25px;
}

/* Confetti animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: #f0f;
    position: fixed;
    animation: confetti 5s ease-in-out infinite;
    transform-origin: left top;
}

.confetti:nth-child(1) {
    background-color: #f00;
    left: 10%;
    animation-delay: 0s;
}

.confetti:nth-child(2) {
    background-color: #0f0;
    left: 30%;
    animation-delay: 0.5s;
}

.confetti:nth-child(3) {
    background-color: #00f;
    left: 50%;
    animation-delay: 1s;
}

.confetti:nth-child(4) {
    background-color: #ff0;
    left: 70%;
    animation-delay: 1.5s;
}

.confetti:nth-child(5) {
    background-color: #0ff;
    left: 90%;
    animation-delay: 2s;
}

@keyframes confetti {
    0% {
        transform: translateY(-100vh) rotateZ(0deg);
    }
    100% {
        transform: translateY(100vh) rotateZ(720deg);
    }
}

/* ============================================
   Service Request View Modal Styles
   ============================================ */
/* Service Request modal styles */
#requestViewModal .request-header {
    border-left: 4px solid #17a2b8;
}

#requestViewModal .bg-gradient-light {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

#requestViewModal .card {
    transition: transform 0.2s;
}

#requestViewModal .card:hover {
    transform: translateY(-2px);
}

/* Make modal body scrollable with consistent padding */
#requestViewModal .modal-body {
    max-height: calc(100vh - 220px);
}

/* Print styles */
@media print {
    #requestViewModal .modal-header,
    #requestViewModal .modal-footer {
        display: none;
    }

    #requestViewModal .modal-dialog {
        max-width: 100%;
        margin: 0;
    }
}

/* ============================================
   Welcome Modal Styles
   ============================================ */

.welcome-modal .modal-content {
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.welcome-modal .modal-header {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--brand-purple-light) 100%);
    border: none;
    padding: 0.75rem 1.25rem;
}

.welcome-modal .modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.welcome-modal .carousel {
    padding-bottom: 2.5rem;
}

.welcome-modal .carousel-inner {
    position: relative;
    overflow: hidden;
}

.welcome-modal .carousel-item {
    min-height: 320px;
    display: none;
    align-items: center;
    position: relative;
    transition: transform 0.8s ease-in-out;
}

.welcome-modal .carousel-item.active,
.welcome-modal .carousel-item-next,
.welcome-modal .carousel-item-prev {
    display: flex;
}

/* Sliding animation */
.welcome-modal .carousel-item-next:not(.carousel-item-start),
.welcome-modal .carousel-item.active.carousel-item-end {
    transform: translateX(100%);
}

.welcome-modal .carousel-item-prev:not(.carousel-item-end),
.welcome-modal .carousel-item.active.carousel-item-start {
    transform: translateX(-100%);
}

.welcome-modal .carousel-item-next.carousel-item-start,
.welcome-modal .carousel-item-prev.carousel-item-end,
.welcome-modal .carousel-item.active {
    transform: translateX(0);
}

.welcome-modal .carousel-item-next,
.welcome-modal .carousel-item-prev {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.welcome-modal .slide-content {
    padding: 1.25rem 1.5rem;
    width: 100%;
}

.welcome-modal .slide-content p {
    text-align: justify;
}

.welcome-modal .slide-content p.lead {
    text-align: center;
    font-size: 1.35rem;
    font-weight: 500;
}

.welcome-modal .slide-content .d-flex {
    text-align: center;
}

.welcome-modal .slide-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.welcome-modal .icon-wrapper {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.welcome-modal .icon-wrapper.bg-gradient-primary {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--brand-purple-light) 100%);
    box-shadow: 0 10px 30px rgba(101, 37, 131, 0.3);
}

.welcome-modal .icon-wrapper.bg-gradient-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 10px 30px rgba(17, 153, 142, 0.3);
}

.welcome-modal .icon-wrapper.bg-gradient-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.3);
}

.welcome-modal .icon-wrapper.bg-gradient-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 10px 30px rgba(79, 172, 254, 0.3);
}

.welcome-modal .icon-wrapper.bg-gradient-purple {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    box-shadow: 0 10px 30px rgba(168, 237, 234, 0.3);
}

.welcome-modal .icon-wrapper i {
    font-size: 1.5rem;
    color: white;
}

.welcome-modal .icon-wrapper .welcome-logo {
    max-width: 65%;
    max-height: 65%;
    filter: brightness(0) invert(1);
}

.welcome-modal h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--brand-purple-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-modal .lead {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem !important;
}

.welcome-modal p {
    font-size: 0.9rem;
    line-height: 1.6;
}

.welcome-modal .feature-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem;
    margin: 0.25rem 0;
    border-left: 3px solid;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.welcome-modal .feature-card:hover {
    transform: translateX(3px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.welcome-modal .feature-card h6 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.welcome-modal .feature-card small {
    font-size: 0.8rem;
}

.welcome-modal .feature-card i {
    font-size: 1.1rem;
}

.welcome-modal .feature-card.border-primary { border-left-color: var(--bs-primary); }
.welcome-modal .feature-card.border-success { border-left-color: #11998e; }
.welcome-modal .feature-card.border-warning { border-left-color: #f5576c; }
.welcome-modal .feature-card.border-info { border-left-color: #4facfe; }

.welcome-modal .carousel-indicators {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto 0.5rem auto;
    justify-content: center;
    z-index: 2;
}

.welcome-modal .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 4px;
    background-color: var(--bs-primary);
    opacity: 0.4;
    transition: all 0.3s ease;
    border: none;
}

.welcome-modal .carousel-indicators button.active {
    opacity: 1;
    transform: scale(1.2);
    background-color: var(--brand-purple-light);
}

.welcome-modal .carousel-control-prev,
.welcome-modal .carousel-control-next {
    width: 45px;
    opacity: 0.7;
    top: 50%;
    transform: translateY(-50%);
}

.welcome-modal .carousel-control-prev:hover,
.welcome-modal .carousel-control-next:hover {
    opacity: 1;
}

.welcome-modal .carousel-control-prev {
    left: -55px;
}

.welcome-modal .carousel-control-next {
    right: -55px;
}

.welcome-modal .carousel-control-prev-icon,
.welcome-modal .carousel-control-next-icon {
    background-color: var(--bs-primary);
    border-radius: 50%;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(101, 37, 131, 0.3);
    width: 35px;
    height: 35px;
}

.welcome-modal .modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 0.75rem 1.25rem;
    background: #f8f9fa;
}

.welcome-modal .form-check-label {
    font-size: 0.9rem;
}

.welcome-modal .btn-primary {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--brand-purple-light) 100%);
    border: none;
    padding: 0.6rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.welcome-modal .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(101, 37, 131, 0.4);
}

.welcome-modal .progress-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--bs-primary) 0%, var(--brand-purple-light) 100%);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .welcome-modal .carousel-control-prev {
        left: 5px;
    }

    .welcome-modal .carousel-control-next {
        right: 5px;
    }
}

@media (max-width: 991.98px) {
    /* Full screen modal on mobile/tablet */
    .welcome-modal .modal-dialog {
        margin: 0 auto !important;
        max-width: 100% !important;
        height: 100vh;
    }

    .welcome-modal .modal-content {
        height: 100vh;
    }

    .welcome-modal .modal-header {
        padding: 0.6rem 1rem;
        flex-shrink: 0;
    }

    .welcome-modal .modal-title {
        font-size: 1rem;
    }

    .welcome-modal .modal-body {
        flex: 1;
        overflow: hidden;
        padding: 0;
    }

    .welcome-modal .carousel {
        height: 100%;
        padding-bottom: 3rem;
    }

    .welcome-modal .carousel-inner {
        height: 100%;
    }

    .welcome-modal .carousel-item {
        min-height: auto;
        height: 100%;
    }

    .welcome-modal .slide-content {
        padding: 1rem;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .welcome-modal .slide-header {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .welcome-modal .icon-wrapper {
        width: 45px;
        height: 45px;
    }

    .welcome-modal .icon-wrapper i {
        font-size: 1.3rem;
    }

    .welcome-modal h2 {
        font-size: 1.2rem;
    }

    .welcome-modal .lead {
        font-size: 0.9rem;
    }

    .welcome-modal p {
        font-size: 0.85rem;
    }

    .welcome-modal .feature-card {
        padding: 0.6rem;
    }

    .welcome-modal .feature-card h6 {
        font-size: 0.85rem;
    }

    .welcome-modal .feature-card small {
        font-size: 0.75rem;
    }

    /* Hide navigation arrows on mobile */
    .welcome-modal .carousel-control-prev,
    .welcome-modal .carousel-control-next {
        display: none;
    }

    .welcome-modal .carousel-indicators {
        margin-bottom: 1rem;
    }

    .welcome-modal .carousel-indicators button {
        width: 8px;
        height: 8px;
        margin: 0 3px;
    }

    .welcome-modal .modal-footer {
        padding: 0.6rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
        flex-shrink: 0;
    }

    .welcome-modal .btn-primary {
        width: 100%;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   Service View Modal - Mobile Improvements
   ============================================ */
@media (max-width: 576px) {
    /* Service quick actions mobile styling */
    #serviceQuickActions .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
    }

    #serviceQuickActions .btn i {
        margin-right: 0.25rem;
    }

    /* Ensure buttons don't overflow on very small screens */
    #serviceViewModal .modal-footer {
        padding: 12px 15px;
    }
}

/* ============================================
   Invoice View Modal - Mobile Improvements
   ============================================ */
@media (max-width: 576px) {
    #invoiceViewModal .modal-footer {
        flex-direction: column;
        gap: 8px;
        padding: 12px 15px;
    }

    #invoiceViewModal .modal-footer .btn {
        width: 100%;
        min-width: unset;
    }
}

/* ============================================
   Mobile Button Improvements - Very Small Screens
   ============================================ */
@media (max-width: 360px) {
    /* Adjust button sizing for very small screens (< 360px) */
    .service-card .btn,
    .invoice-card .btn,
    .payment-card .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }

    /* Adjust icon spacing */
    .btn i {
        margin-right: 0.2rem;
    }

    /* Service quick actions - extra compact */
    #serviceQuickActions .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.5rem;
    }
}

/* ============================================
   SPM Promotional Pricing Styles
   ============================================ */

/* Promotional badge on dashboard stats */
.promo-badge-small {
    font-size: 0.5em;
}

/* Mobile price display size */
.mobile-price-text {
    font-size: 1.15rem;
}

/* Promotional savings text */
.promo-savings-text {
    color: var(--bs-success);
}

.promo-savings-text i {
    margin-right: 0.25rem;
}

/* Plan change modal promotional pricing */
.plan-option-promo-badge {
    font-size: 0.75em;
    margin-left: 0.5rem;
}

/* Promotional price highlight */
.price-with-promo {
    position: relative;
}

.price-with-promo .promo-badge {
    vertical-align: middle;
    margin-left: 0.5rem;
}

/* Small promo badge for service details */
.promo-badge-sm {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
}

/* Savings indicator animation (subtle pulse) */
@keyframes promo-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.promo-savings-text {
    animation: promo-pulse 3s ease-in-out infinite;
}

/* ==========================================================================
   Mobile ergonomics floor
   98% of portal traffic is phones, so these are the baseline, not an override.
   Measured before adding: 149 controls under 40px and 63 text nodes under 12px
   across the 13 portal routes. Bootstrap's -sm control variants render ~31px.
   ========================================================================== */
@media (max-width: 767.98px), (hover: none) and (pointer: coarse) {

    /* Width alone misses tablets and unfolded foldables (768-1199px), which are still
       thumbs on glass. The pointer/hover pair catches any touch device regardless of
       how many pixels it reports; a mouse-driven desktop matches neither clause. */

    /* Touch floor. 44px is the smallest reliable thumb target. */
    .btn,
    .form-control,
    .form-select,
    .input-group-sm > .btn,
    .input-group-sm > .form-control,
    .form-control-sm,
    .form-select-sm,
    .btn-close,
    .nav-link,
    .dropdown-item {
        min-height: 44px;
    }

    /* Nav links are inline-ish by default, so min-height alone leaves the text at the
       top of the box; centring makes the whole 44px actually feel like the target. */
    .nav-link,
    .dropdown-item {
        display: flex;
        align-items: center;
    }

    .btn-close {
        min-width: 44px;
        background-position: center;
    }

    /* 16px is the threshold below which iOS Safari zooms the viewport on focus,
       which then leaves the user scrolled sideways on a page that had no overflow. */
    .form-control,
    .form-select,
    .form-control-sm,
    .form-select-sm,
    /* Bootstrap's .input-group-sm > .form-control is more specific than .form-control
       alone, so it kept the equipment quantity fields at 14px until listed here. */
    .input-group-sm > .form-control,
    .input-group-sm > .form-select,
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="search"],
    input[type="date"],
    textarea,
    select {
        font-size: 16px;
    }

    /* Type floor: nothing below 12px on a phone. */
    small,
    .small,
    .badge,
    .equipment-price-vat {
        font-size: 0.75rem;
    }

    /* Pagination is primary navigation on a phone, and Bootstrap renders it at 29x31 —
       small enough that hitting page 3 instead of page 2 is routine. Selector must be
       `.pagination .page-link` to match the existing 36px rule's specificity. */
    .pagination .page-link {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
    }

    /* Bootstrap switches ship at 32x16. Fine for a mouse, not for a thumb. */
    .form-switch .form-check-input {
        width: 3rem;
        height: 1.5rem;
    }

    /* The switch graphic stays switch-sized; the row it sits in becomes the target, so
       the whole associated label is tappable rather than just the 24px control. */
    .form-check {
        display: flex;
        align-items: center;
        min-height: 44px;
    }

    .form-check .form-check-label {
        display: flex;
        align-items: center;
        min-height: 44px;
    }
}
