/* Loaded after admin.css so SMM panel cockpit & responsive rules win. */
@import url("/css/galaxy-theme.css");

/* Strictly hide legacy topbar */
.topbar {
    display: none !important;
}

/* ============================================================================
 * SMM PANEL 2-TIER RESPONSIVE ARCHITECTURE
 * Mode 1: PC Mode (>= 1024px)
 * Mode 2: Mobile / Tablet / Small Screens (< 1024px)
 * ============================================================================ */

/* ============================================================================
 * 🖥️ PC MODE SPECIFIC RULES (>= 1024px) - 100% ISOLATED & UNTOUCHED
 * ============================================================================ */
@media (min-width: 1024px) {
    .panel-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 260px !important;
        z-index: 1000 !important;
        display: flex !important;
        flex-direction: column !important;
        transform: none !important;
    }

    body:not(.sidebar-open) .panel-sidebar,
    body.sidebar-open .panel-sidebar {
        width: 260px !important;
        transform: none !important;
        display: flex !important;
    }

    body:not(.sidebar-open) .sidebar-brand-info,
    body:not(.sidebar-open) .sidebar-label,
    body:not(.sidebar-open) .nav-label,
    body:not(.sidebar-open) .nav-chevron,
    body:not(.sidebar-open) .sidebar-footer {
        display: block !important;
    }

    body:not(.sidebar-open) .sidebar-nav-list .nav-link {
        justify-content: flex-start !important;
        padding: 9px 12px !important;
    }

    .panel-menu-toggle {
        display: none !important;
    }

    .smm-top-header {
        position: fixed !important;
        top: 0 !important;
        left: 260px !important;
        right: 0 !important;
        height: 64px !important;
        z-index: 999 !important;
        padding: 0 24px !important;
    }

    .wrap {
        margin-left: 260px !important;
        padding-top: 84px !important;
        padding-left: 24px !important;
        padding-right: 24px !important;
        padding-bottom: 48px !important;
        width: calc(100vw - 260px) !important;
        max-width: none !important;
        box-sizing: border-box !important;
    }

    .admin-master-detail {
        display: grid !important;
        grid-template-columns: minmax(280px, 320px) minmax(0, 1fr) !important;
        gap: 20px !important;
        align-items: start !important;
        position: relative !important;
    }

    .admin-master-nav {
        position: sticky !important;
        top: 78px !important;
        max-height: calc(100vh - 94px) !important;
        overflow-y: auto !important;
        overscroll-behavior: contain !important;
        scrollbar-width: thin !important;
        align-self: start !important;
        z-index: 20 !important;
    }

    .promo-toolbar {
        min-width: 0;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .promo-toolbar > * {
        min-width: 0 !important;
    }

    body > .modal,
    body > .brand-settings-modal {
        left: 260px !important;
        right: 0 !important;
        width: auto !important;
        max-width: calc(100vw - 260px) !important;
        padding: clamp(16px, 3vw, 42px) !important;
    }

    body > .modal > .modal-content,
    body > .modal > form.modal-content,
    body > .brand-settings-modal > .modal-content {
        width: min(100%, 1400px);
        max-width: 100% !important;
        max-height: calc(100vh - 80px) !important;
        margin: auto;
    }

    .modal-content.user-profile-modal {
        width: min(100%, 1180px) !important;
    }

    .orders-list-card {
        display: flex;
        flex-direction: column;
        height: clamp(520px, 75vh, 800px);
        min-height: 0;
        overflow: hidden;
    }

    .orders-list-card .order-card-list {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    .orders-list-card .order-card-list::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    .order-card-header {
        display: grid !important;
        grid-template-columns: minmax(180px, 1.5fr) minmax(120px, 1fr) minmax(130px, 1fr) minmax(95px, .8fr) minmax(120px, 1fr) minmax(120px, .9fr) 86px !important;
        gap: 14px !important;
        align-items: center !important;
    }

    .order-card-main {
        display: grid !important;
        grid-template-columns: minmax(180px, 1.5fr) minmax(120px, 1fr) minmax(130px, 1fr) minmax(95px, .8fr) minmax(120px, 1fr) minmax(120px, .9fr) 86px !important;
        gap: 14px !important;
        align-items: center !important;
    }
}

/* ============================================================================
 * 📱 MOBILE, TABLET & SMALL SCREENS (< 1024px)
 * 100% Edge-to-Edge Space Maximization (2% - 4% margins)
 * Fluid Auto-Scaling & Zero Layout Glitches
 * ============================================================================ */
@media (max-width: 1023px) {
    /* 1. Base Viewport & Spacing (Strict 2%-4% Edge Gap) */
    html, body {
        overflow-x: clip !important;
        width: 100% !important;
        max-width: 100vw !important;
        position: relative !important;
    }

    .wrap {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        padding-top: 66px !important;
        padding-left: clamp(8px, 2.5vw, 12px) !important;
        padding-right: clamp(8px, 2.5vw, 12px) !important;
        padding-bottom: 28px !important;
        box-sizing: border-box !important;
        overflow-x: clip !important;
    }

    /* 2. Top Header Mobile Sizing */
    .smm-top-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 56px !important;
        z-index: 9999 !important;
        padding: 0 clamp(8px, 2.5vw, 14px) !important;
        background: rgba(11, 17, 33, 0.96) !important;
        backdrop-filter: blur(20px) saturate(180%) !important;
        -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
        border-bottom: 1px solid rgba(56, 189, 248, 0.15) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
    }

    .smm-header-left {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .panel-menu-toggle {
        display: flex !important;
        width: 36px !important;
        height: 36px !important;
        padding: 7px !important;
        border-radius: 8px !important;
        background: rgba(56, 189, 248, 0.12) !important;
        border: 1px solid rgba(56, 189, 248, 0.3) !important;
        flex-shrink: 0 !important;
    }

    .smm-breadcrumbs {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        min-width: 0 !important;
    }

    .breadcrumb-root,
    .breadcrumb-separator {
        display: none !important;
    }

    .breadcrumb-current {
        font-size: 13.5px !important;
        max-width: clamp(120px, 35vw, 220px) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .smm-header-right {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        flex-shrink: 0 !important;
    }

    .smm-status-badge {
        font-size: 10.5px !important;
        padding: 3px 8px !important;
    }

    .smm-support-btn {
        display: inline-flex !important;
        font-size: 11px !important;
        padding: 4px 9px !important;
        white-space: nowrap !important;
    }

    .smm-header-avatar {
        width: 34px !important;
        height: 34px !important;
        border-radius: 9px !important;
        flex-shrink: 0 !important;
    }

    /* 3. Mobile Sidebar Drawer */
    .panel-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: min(285px, 82vw) !important;
        height: 100dvh !important;
        z-index: 10001 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.7) !important;
    }

    body.sidebar-open .panel-sidebar {
        transform: translateX(0) !important;
    }

    .panel-sidebar-backdrop {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        background: rgba(0, 0, 0, 0.72) !important;
        backdrop-filter: blur(6px) !important;
        -webkit-backdrop-filter: blur(6px) !important;
        z-index: 10000 !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity 0.25s ease !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body.sidebar-open .panel-sidebar-backdrop {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* 4. Global Cards & Grid Scaling */
    .card,
    .order-filters-card,
    .orders-list-card {
        padding: clamp(10px, 3vw, 15px) !important;
        border-radius: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin-bottom: 12px !important;
    }

    .dashboard-grid,
    .admin-hero-grid,
    .bank-hero-grid,
    .order-stats-grid,
    .user-stats-grid,
    .wallet-stats-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
        width: 100% !important;
    }

    .dash-card {
        padding: 10px 12px !important;
        gap: 10px !important;
        border-radius: 10px !important;
    }

    .dash-card .dash-icon {
        width: 36px !important;
        height: 36px !important;
        border-radius: 9px !important;
    }

    .dash-card .dash-icon img {
        width: 24px !important;
        height: 24px !important;
    }

    .dash-card .dash-label {
        font-size: 11.5px !important;
    }

    .dash-card .dash-value {
        font-size: 16px !important;
    }

    /* 5. BOT Control Master-Detail (admin.html) */
    .admin-master-detail {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
        margin-top: 10px !important;
    }

    .admin-master-nav {
        position: static !important;
        width: 100% !important;
        max-height: none !important;
        padding: 8px !important;
        border-radius: 12px !important;
        box-sizing: border-box !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .admin-master-header {
        display: none !important;
    }

    .admin-master-list {
        display: flex !important;
        flex-direction: row !important;
        gap: 6px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        padding-bottom: 2px !important;
        width: 100% !important;
    }

    .admin-master-list::-webkit-scrollbar {
        display: none !important;
    }

    .admin-master-item {
        flex: 0 0 auto !important;
        width: auto !important;
        padding: 7px 12px !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
        gap: 6px !important;
    }

    .admin-master-item .item-arrow,
    .admin-master-item .item-hint {
        display: none !important;
    }

    .admin-master-item .item-icon {
        width: 22px !important;
        height: 22px !important;
        font-size: 12px !important;
        border-radius: 6px !important;
    }

    .admin-master-item .item-title {
        font-size: 12px !important;
    }

    .admin-detail-pane {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Telegram Message Templates Accordion on Mobile */
    .telegram-message-template {
        border-radius: 8px !important;
        margin-bottom: 6px !important;
    }

    .telegram-msg-header {
        padding: 8px 10px !important;
        gap: 8px !important;
    }

    .telegram-msg-header-left {
        gap: 6px !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .telegram-msg-group-badge {
        font-size: 9px !important;
        padding: 1px 5px !important;
        border-radius: 4px !important;
    }

    .telegram-msg-title {
        font-size: 12px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: calc(100vw - 120px) !important;
    }

    .telegram-msg-key {
        display: none !important;
    }

    .telegram-msg-toggle-btn {
        width: 24px !important;
        height: 24px !important;
        border-radius: 5px !important;
    }

    .telegram-msg-body {
        padding: 10px !important;
    }

    .editor-toolbar-row {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        margin-top: 6px !important;
    }

    .editor-chip-btn {
        padding: 3px 7px !important;
        font-size: 10.5px !important;
        border-radius: 5px !important;
        min-height: 28px !important;
    }

    .editor-toolbar-row .btn.ok.small {
        margin-left: 0 !important;
        width: 100% !important;
        margin-top: 4px !important;
        justify-content: center !important;
        padding: 7px !important;
    }

    /* Bot Commands row on mobile */
    .telegram-command-item,
    .command-row-item {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        padding: 10px !important;
        background: rgba(15, 23, 42, 0.7) !important;
        border-radius: 8px !important;
        margin-bottom: 8px !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
    }

    .telegram-command-item input,
    .command-row-item input {
        width: 100% !important;
    }

    /* 6. Order Management Page (orders.html) */
    .order-filters-card {
        padding: 12px !important;
        margin-bottom: 12px !important;
    }

    .order-filters-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        margin-bottom: 10px !important;
        padding-bottom: 8px !important;
    }

    .order-filters-actions {
        display: flex !important;
        width: 100% !important;
        justify-content: space-between !important;
        gap: 6px !important;
    }

    .order-filters-actions button {
        flex: 1 1 50% !important;
        justify-content: center !important;
    }

    .order-filters-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .order-date-range {
        display: grid !important;
        grid-template-columns: 1fr auto 1fr !important;
        gap: 4px !important;
        align-items: center !important;
    }

    .order-date-range input[type="date"] {
        padding: 0 4px !important;
        font-size: 11.5px !important;
    }

    .orders-list-card {
        height: auto !important;
        max-height: none !important;
        padding: 10px !important;
    }

    .orders-list-card .order-card-list {
        overflow: visible !important;
    }

    .order-card-header {
        display: none !important;
    }

    /* ✨ Mobile Card View for Orders */
    .order-card {
        padding: 12px 14px !important;
        border-radius: 12px !important;
        margin-bottom: 10px !important;
        background: rgba(15, 23, 42, 0.85) !important;
        border: 1px solid rgba(56, 189, 248, 0.16) !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }

    .order-card-main {
        display: flex !important;
        flex-direction: column !important;
        gap: 7px !important;
        align-items: stretch !important;
        width: 100% !important;
    }

    .order-card-main > div:nth-child(1) {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }

    .order-card-main > div:nth-child(2) {
        display: flex !important;
        justify-content: space-between !important;
        align-items: baseline !important;
        border-top: 1px dashed rgba(255, 255, 255, 0.08) !important;
        padding-top: 6px !important;
    }

    .order-card-main > div:nth-child(3) {
        display: block !important;
        width: 100% !important;
    }

    .order-card-main > div:nth-child(4) {
        display: inline-flex !important;
    }

    .order-card-main > div:nth-child(5) {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        border-top: 1px dashed rgba(255, 255, 255, 0.08) !important;
        padding-top: 6px !important;
    }

    .order-card-main > div:nth-child(6) {
        display: inline-flex !important;
    }

    .order-card-main > div:nth-child(7) {
        width: 100% !important;
        margin-top: 4px !important;
    }

    .btn-action-api-order,
    .order-detail-btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 8px 12px !important;
        min-width: 0 !important;
        max-width: none !important;
        font-size: 13px !important;
        border-radius: 8px !important;
    }

    /* 7. API Products Page (api-products.html) */
    .providers-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .provider-card {
        padding: 12px !important;
    }

    .apiprod-toolbar,
    .api-filter-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .apiprod-toolbar input,
    .apiprod-toolbar select,
    .api-filter-row select {
        width: 100% !important;
        min-width: 0 !important;
    }

    .apiprod-toolbar .btn-group,
    .api-action-buttons {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .apiprod-toolbar .btn-group > *,
    .api-action-buttons > * {
        flex: 1 1 calc(50% - 4px) !important;
        min-width: 0 !important;
        justify-content: center !important;
        padding: 8px !important;
        font-size: 12px !important;
    }

    /* 8. Global Table Horizontal Anti-Overflow Container */
    .table-wrap,
    .apiprod-table-container,
    .warranty-table-wrap,
    .users-table-wrap,
    .payments-table-wrap,
    .deposit-table-wrap,
    .table-responsive {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        display: block !important;
        border-radius: 10px !important;
        margin-bottom: 10px !important;
        scrollbar-width: thin !important;
        scrollbar-color: rgba(56, 189, 248, 0.4) rgba(15, 23, 42, 0.6) !important;
    }

    .table-wrap::-webkit-scrollbar,
    .apiprod-table-container::-webkit-scrollbar,
    .warranty-table-wrap::-webkit-scrollbar,
    .users-table-wrap::-webkit-scrollbar,
    .payments-table-wrap::-webkit-scrollbar,
    .deposit-table-wrap::-webkit-scrollbar {
        height: 6px !important;
        display: block !important;
    }

    .table-wrap::-webkit-scrollbar-thumb,
    .apiprod-table-container::-webkit-scrollbar-thumb,
    .warranty-table-wrap::-webkit-scrollbar-thumb {
        background: rgba(56, 189, 248, 0.4) !important;
        border-radius: 3px !important;
    }

    .apiprod-table,
    .table,
    table {
        min-width: 680px !important;
        width: 100% !important;
    }

    /* 9. Product & Category (product.html) */
    .product-layout-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .product-filter-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .product-filter-actions > * {
        width: 100% !important;
        justify-content: center !important;
    }

    .product-folder-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    .folder-header-right {
        width: 100% !important;
        justify-content: space-between !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .product-child-card,
    .root-product-main {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .child-col-actions,
    .root-col-actions {
        width: 100% !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
    }

    /* 10. Global Modal Dialogs Mobile Centering & Touch Adaptation */
    body > .modal,
    body > .brand-settings-modal,
    .modal {
        position: fixed !important;
        inset: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        max-width: 100vw !important;
        padding: clamp(8px, 2.5vw, 14px) !important;
        display: grid !important;
        place-items: center !important;
        box-sizing: border-box !important;
        z-index: 10000 !important;
    }

    body > .modal > .modal-content,
    body > .brand-settings-modal > .modal-content,
    .modal-content,
    .modal-content.user-profile-modal,
    .api-picker-modal {
        width: 100% !important;
        max-width: calc(100vw - clamp(14px, 3.5vw, 24px)) !important;
        max-height: calc(100dvh - 20px) !important;
        overflow-y: auto !important;
        padding: clamp(12px, 3vw, 18px) !important;
        margin: auto !important;
        border-radius: 14px !important;
        box-sizing: border-box !important;
    }

    .form-row,
    .product-2col-row,
    .grid-2,
    .grid-3,
    .api-summary-grid,
    .api-picker-body {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .modal-foot,
    .modal-footer {
        display: flex !important;
        flex-direction: column-reverse !important;
        gap: 8px !important;
        width: 100% !important;
        margin-top: 14px !important;
    }

    .modal-foot > button,
    .modal-foot > .btn,
    .modal-footer > button,
    .modal-footer > .btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 9px 14px !important;
    }

    /* 11. Form Inputs - Touch Optimization */
    input, select, textarea {
        font-size: 14px !important; /* Prevents auto-zoom in iOS Safari */
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 12. Emoji Gallery & Promo Lists */
    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
        gap: 8px !important;
    }

    .promo-toolbar {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .promo-toolbar > * {
        width: 100% !important;
    }

    /* 13. Warranty Collapsible on Mobile */
    .warranty-collapse-toggle {
        padding: 12px 14px !important;
        min-height: 50px !important;
    }

    .warranty-collapse-toggle b {
        font-size: 13.5px !important;
    }

    .warranty-collapse-body {
        padding: 12px 14px !important;
    }

    /* 14. Toast Notifications on Mobile */
    .toast-stack {
        left: 12px !important;
        right: 12px !important;
        bottom: 16px !important;
        width: calc(100% - 24px) !important;
    }

    .app-toast {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* ============================================================================
 * 📱 SMALL MOBILE DEVICES (<= 480px)
 * Ultra-Compact Fine-Tuning
 * ============================================================================ */
@media (max-width: 480px) {
    .smm-status-badge {
        display: none !important;
    }

    .smm-support-btn span {
        display: none !important;
    }

    .smm-support-btn::before {
        content: "💬" !important;
        font-size: 14px !important;
    }

    .smm-support-btn {
        padding: 5px 8px !important;
    }

    .dashboard-grid,
    .admin-hero-grid,
    .bank-hero-grid,
    .order-stats-grid,
    .user-stats-grid,
    .wallet-stats-grid {
        grid-template-columns: 1fr !important;
    }

    .apiprod-toolbar .btn-group > *,
    .api-action-buttons > * {
        flex: 1 1 100% !important;
    }

    .action-card-desc {
        font-size: 11px !important;
    }

    .action-card-btn-pill {
        display: none !important;
    }
}

/* ============================================================================
 * UNIVERSAL TEXTAREA SCROLLBAR & RESIZE HANDLE (HIGHEST PRIORITY)
 * ============================================================================ */
textarea,
.universal-rich-editor textarea,
.telegram-message-template textarea {
    width: 100% !important;
    min-height: 140px !important;
    max-height: 80vh !important;
    resize: vertical !important;
    font-family: var(--font-main, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif) !important;
    font-size: 13.5px !important;
    line-height: 1.6 !important;
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 8px !important;
    padding: 12px 14px !important;
    box-sizing: border-box !important;
    display: block !important;
    color: #f8fafc !important;
    overflow-y: auto !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(56, 189, 248, 0.45) rgba(15, 23, 42, 0.6) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}

textarea:focus,
.universal-rich-editor textarea:focus,
.telegram-message-template textarea:focus {
    border-color: #38bdf8 !important;
    background: rgba(15, 23, 42, 0.98) !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18) !important;
    outline: none !important;
}

textarea::-webkit-scrollbar {
    width: 8px !important;
    height: 8px !important;
    display: block !important;
}

textarea::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6) !important;
    border-radius: 4px !important;
}

textarea::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.35) !important;
    border-radius: 4px !important;
    border: 1px solid rgba(56, 189, 248, 0.2) !important;
}

textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.65) !important;
}

textarea::-webkit-scrollbar-corner {
    background: rgba(15, 23, 42, 0.8) !important;
}

textarea::-webkit-resizer {
    background-color: transparent !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cline x1='14' y1='4' x2='4' y2='14' stroke='%2338bdf8' stroke-width='1.5' stroke-linecap='round'/%3E%3Cline x1='14' y1='8' x2='8' y2='14' stroke='%2338bdf8' stroke-width='1.5' stroke-linecap='round'/%3E%3Cline x1='14' y1='12' x2='12' y2='14' stroke='%2338bdf8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") !important;
    background-position: right bottom !important;
    background-repeat: no-repeat !important;
    width: 16px !important;
    height: 16px !important;
}

/* ============================================================================
 * ⚡ API ORDER ACTION BUTTON & MODAL
 * ============================================================================ */
.btn-action-api-order {
    background: linear-gradient(135deg, #f59e0b, #ef4444) !important;
    border: 1px solid #fde047 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    padding: 0 14px !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    border-radius: 8px !important;
}

.btn-action-api-order:hover {
    transform: translateY(-1px) scale(1.03) !important;
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
    border-color: #ffffff !important;
    filter: brightness(1.1) !important;
}

.api-order-summary-card {
    background: radial-gradient(130% 120% at 50% 0%, rgba(56, 189, 248, 0.08) 0%, rgba(15, 23, 42, 0.85) 100%);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.api-summary-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.api-summary-label {
    font-size: 11px;
    color: var(--muted, #94a3b8);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.api-summary-value {
    color: #ffffff;
    font-size: 14.5px;
    display: block;
    margin-top: 2px;
    font-family: var(--font-heading, 'Outfit', sans-serif);
}

.api-summary-sub {
    font-size: 12px;
    color: var(--muted, #94a3b8);
    margin-top: 2px;
}

.api-summary-price {
    font-size: 18px;
    color: #38bdf8;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    display: block;
}

.api-order-alert-box {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.3);
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.api-order-alert-box .alert-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.api-order-alert-box .alert-title {
    font-size: 11.5px;
    font-weight: 700;
    color: #fb7185;
}

.api-order-alert-box .alert-desc {
    font-size: 12px;
    color: #fecdd3;
    margin-top: 2px;
    line-height: 1.4;
    word-break: break-word;
}

.api-action-options-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.api-action-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.api-action-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 13px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
}

.api-action-card:hover {
    transform: translateY(-2px);
}

.action-card-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.action-card-content {
    flex: 1;
    min-width: 0;
}

.action-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    font-family: var(--font-heading, 'Outfit', sans-serif);
}

.action-card-desc {
    font-size: 11.5px;
    color: var(--muted, #94a3b8);
    margin-top: 2px;
    line-height: 1.35;
}

.action-card-btn-pill {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

/* Individual Option Variants */
.opt-retry:hover {
    border-color: rgba(168, 85, 247, 0.6);
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.15), rgba(15, 23, 42, 0.8));
    box-shadow: 0 4px 22px rgba(168, 85, 247, 0.25);
}
.icon-purple {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(99, 102, 241, 0.25));
    border: 1px solid rgba(168, 85, 247, 0.4);
}
.btn-purple {
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #c084fc;
}
.opt-retry:hover .btn-purple {
    background: linear-gradient(135deg, #9333ea, #6366f1);
    color: #ffffff;
    border-color: #a855f7;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.opt-manual:hover {
    border-color: rgba(52, 211, 153, 0.6);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(15, 23, 42, 0.8));
    box-shadow: 0 4px 22px rgba(52, 211, 153, 0.25);
}
.icon-emerald {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.25), rgba(20, 184, 166, 0.25));
    border: 1px solid rgba(52, 211, 153, 0.4);
}
.btn-emerald {
    background: rgba(52, 211, 153, 0.2);
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: #6ee7b7;
}
.opt-manual:hover .btn-emerald {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    border-color: #34d399;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
}

.opt-refund:hover {
    border-color: rgba(244, 63, 94, 0.6);
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.15), rgba(15, 23, 42, 0.8));
    box-shadow: 0 4px 22px rgba(244, 63, 94, 0.25);
}
.icon-rose {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.25), rgba(249, 115, 22, 0.25));
    border: 1px solid rgba(244, 63, 94, 0.4);
}
.btn-rose {
    background: rgba(244, 63, 94, 0.2);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #fda4af;
}
.opt-refund:hover .btn-rose {
    background: linear-gradient(135deg, #e11d48, #f43f5e);
    color: #ffffff;
    border-color: #fb7185;
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}

.opt-detail:hover {
    border-color: rgba(56, 189, 248, 0.6);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(15, 23, 42, 0.8));
    box-shadow: 0 4px 22px rgba(56, 189, 248, 0.25);
}
.icon-sky {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(59, 130, 246, 0.25));
    border: 1px solid rgba(56, 189, 248, 0.4);
}
.btn-sky {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #7dd3fc;
}
.opt-detail:hover .btn-sky {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #ffffff;
    border-color: #7dd3fc;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}


/* MODAL FIX FOR SMM PANEL */
.modal:not(.show):not(.active) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
    z-index: -9999 !important;
}

@media (min-width: 1024px) {
    body > .modal.show,
    body > .modal.active {
        left: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        z-index: 100000 !important;
    }
}
