/* ==========================================================================
   QDM Seller Dashboard Stylesheet
   ========================================================================== */

/* Dashboard Base Wrapper */
.qdm-dashboard-wrapper {
    max-width: 960px;
    width: 100%;
    margin: 0 auto 20px auto;
    padding-top: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; 
    background: #ffffff; 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: relative;
    box-sizing: border-box;
}

/* Hero Banner & Logo */
.qdm-dashboard-wrapper .hero-banner {
    position: relative; 
    width: 100%; 
    height: 180px; 
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat;
}

.qdm-dashboard-wrapper .hero-overlay {
    position: absolute; 
    inset: 0; 
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.05) 50%, rgba(0,0,0,0.4) 100%);
}

.qdm-dashboard-wrapper .shop-logo-img {
    position: absolute; 
    bottom: -35px; 
    left: 20px;
    width: 80px; 
    height: 80px; 
    border-radius: 50%; 
    border: 3px solid #ffffff; 
    object-fit: cover; 
    background: #ffffff; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    z-index: 10;
}

/* Shop Header Details */
.qdm-dashboard-wrapper .shop-details-container {
    padding: 45px 20px 20px 20px;
    background: #ffffff; 
    border-bottom: 1px solid #e2e8f0;
}

.qdm-shop-header-row {
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    flex-wrap: wrap; 
    gap: 15px;
}

.qdm-shop-main-info {
    flex: 1;
    min-width: 260px;
}

.qdm-shop-title {
    margin: 0 0 6px 0; 
    font-size: 20px; 
    font-weight: 800; 
    color: #0f172a;
    line-height: 1.5;
}

.qdm-info-text {
    margin: 0 0 6px 0; 
    font-size: 13px; 
    color: #475569; 
    display: flex; 
    align-items: flex-start; 
    gap: 6px; 
    line-height: 1.6;
}

.qdm-viber-text {
    margin: 0 0 6px 0; 
    font-size: 13px; 
    color: #7360f2; 
    font-weight: 600; 
    display: flex; 
    align-items: center; 
    gap: 6px;
    line-height: 1.5;
}

.qdm-bio-badge {
    margin: 6px 0 10px 0; 
    font-size: 13px; 
    color: #334155; 
    font-weight: 500; 
    line-height: 1.6; 
    word-break: break-word; 
    background: #f1f5f9; 
    padding: 6px 12px; 
    border-radius: 6px; 
    display: inline-block;
}

.qdm-social-row {
    display: flex; 
    align-items: center; 
    gap: 8px; 
    margin-top: 6px;
}

.qdm-social-icon {
    width: 32px; 
    height: 32px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: #ffffff !important; 
    text-decoration: none !important;
}

.qdm-social-tiktok { background: #000000; }
.qdm-social-facebook { background: #1877f2; }
.qdm-social-viber { background: #7360f2; }

button.qdm-settings-btn {
    background: #ffffff !important; 
    border: 1px solid #cbd5e1 !important; 
    width: 42px !important; 
    height: 42px !important; 
    border-radius: 50% !important; 
    display: flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
    cursor: pointer !important; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important; 
    color: #0f172a !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ==========================================================================
   Responsive Main Tab Navigation
   ========================================================================== */
.qdm-tab-navigation-wrapper {
    position: relative;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    width: 100%;
    box-sizing: border-box;
}

.qdm-tab-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.qdm-tab-item {
    flex: 1 1 0px;
    padding: 14px 6px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none !important;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
    text-align: center;
    min-height: 48px;
    min-width: 0;
}

.qdm-tab-item:hover {
    color: #0284c7;
    background: #f8fafc;
}

.qdm-tab-item.active {
    color: #0284c7;
    border-bottom-color: #0284c7;
    background: #f0f9ff;
    font-weight: 700;
}

.qdm-tab-icon {
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qdm-tab-label {
    display: inline-block;
    white-space: nowrap;
}

.qdm-tab-content-area {
    padding: 20px;
    background: #f8fafc;
}

@media screen and (max-width: 640px) {
    .qdm-tab-item {
        padding: 12px 2px;
    }

    .qdm-tab-label {
        display: none !important;
    }

    .qdm-tab-icon {
        font-size: 20px;
    }

    .qdm-tab-content-area {
        padding: 12px 8px;
    }
}

@media screen and (max-width: 480px) {
    .qdm-dashboard-wrapper {
        margin: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    .qdm-dashboard-wrapper .hero-banner {
        height: 130px;
    }
    .qdm-dashboard-wrapper .shop-logo-img {
        width: 70px;
        height: 70px;
        bottom: -30px;
    }
    .qdm-dashboard-wrapper .shop-details-container {
        padding: 40px 14px 16px 14px;
    }
}

/* ==========================================================================
   Full-Width Sub-Tabs Styles
   ========================================================================== */
.qdm-sub-tabs,
.seller-sub-tabs,
.sub-tabs,
.sub-nav-tabs,
.delivery-sub-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-end !important;
    justify-content: space-around !important;
    gap: 12px !important;
    width: calc(100% + 24px) !important;
    margin-left: -12px !important;
    margin-right: -12px !important;
    padding: 10px 16px 4px 16px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth;
    margin-bottom: 20px !important;
    border-bottom: 2px solid #e2e8f0 !important;
    box-sizing: border-box !important;
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

.qdm-sub-tabs::-webkit-scrollbar,
.seller-sub-tabs::-webkit-scrollbar,
.sub-tabs::-webkit-scrollbar,
.sub-nav-tabs::-webkit-scrollbar,
.delivery-sub-tabs::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.qdm-sub-tabs .sub-tab-btn,
.qdm-sub-tabs a,
.qdm-sub-tabs button,
.seller-sub-tabs .tab-btn,
.sub-tabs .sub-tab-btn,
.sub-tabs .tab-item,
.sub-tabs a,
.sub-tabs button,
.sub-nav-tabs .nav-link,
.delivery-sub-tabs button {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 6px 12px 10px 12px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    background-color: transparent !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    transition: all 0.2s ease-in-out !important;
    box-sizing: border-box !important;
}

.qdm-sub-tabs .sub-tab-btn:hover,
.seller-sub-tabs .tab-btn:hover,
.sub-tabs a:hover,
.sub-tabs button:hover {
    color: #2563eb !important;
}

.qdm-sub-tabs .sub-tab-btn.active,
.seller-sub-tabs .tab-btn.active,
.sub-tabs .tab-item.active,
.sub-tabs a.active,
.sub-tabs button.active {
    color: #2563eb !important;
    border-bottom-color: #2563eb !important;
    font-weight: 700 !important;
}

.qdm-sub-tabs img, .qdm-sub-tabs svg, .qdm-sub-tabs i,
.sub-tabs img, .sub-tabs svg, .sub-tabs i {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
    object-fit: contain !important;
    margin-bottom: 2px !important;
}

@media screen and (max-width: 640px) {
    .qdm-sub-tabs,
    .seller-sub-tabs,
    .sub-tabs,
    .sub-nav-tabs,
    .delivery-sub-tabs {
        justify-content: flex-start !important;
        gap: 8px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .qdm-sub-tabs .sub-tab-btn,
    .seller-sub-tabs .tab-btn,
    .sub-tabs .sub-tab-btn,
    .sub-tabs .tab-item,
    .sub-tabs a,
    .sub-tabs button {
        padding: 4px 8px 8px 8px !important;
        font-size: 12px !important;
    }
}

/* Tables Styling */
.qdm-table-wrapper,
.table-responsive,
.qdm-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    margin-bottom: 20px;
    position: relative;
}

.qdm-table-wrapper table,
.table-responsive table,
.qdm-history-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
}

.qdm-table-wrapper th, .qdm-table-wrapper td,
.table-responsive th, .table-responsive td,
.qdm-history-table th, .qdm-history-table td {
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
}

.qdm-history-table tr {
    position: relative;
}

.qdm-history-table tr.is-dropdown-open {
    z-index: 100 !important;
    position: relative;
}

/* ==========================================================================
   Action Menu Dropdown Styles (Fixed Z-Index & Visibility)
   ========================================================================== */
.qdm-action-group { 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    position: relative; 
}

.qdm-dropdown { 
    position: relative; 
    display: inline-block;
}

.qdm-dropdown.is-open {
    z-index: 1000 !important;
}

.qdm-dots-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.qdm-dots-btn:hover,
.qdm-dots-btn:focus { 
    color: #0f172a; 
    background-color: #f1f5f9 !important;
}

.qdm-dropdown-menu { 
    display: none; 
    position: absolute; 
    right: 0; 
    top: 100%; 
    margin-top: 4px;
    background: #ffffff; 
    min-width: 120px; 
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); 
    border-radius: 8px; 
    z-index: 9999 !important; 
    border: 1px solid #e2e8f0; 
    overflow: hidden; 
}

.qdm-dropdown-menu.show { 
    display: block !important; 
}

.qdm-dropdown-menu a { 
    display: flex; 
    align-items: center;
    gap: 6px;
    padding: 9px 14px; 
    font-size: 13px; 
    color: #334155; 
    text-decoration: none !important; 
    text-align: left; 
    transition: background 0.15s ease;
    white-space: nowrap;
}

.qdm-dropdown-menu a:hover { 
    background: #f8fafc; 
    color: #0284c7;
}

.qdm-dropdown-menu a.delete-link { 
    color: #ef4444; 
    border-top: 1px solid #f1f5f9; 
}

.qdm-dropdown-menu a.delete-link:hover { 
    background: #fef2f2; 
    color: #dc2626;
}

/* Modal Popup Styles */
#qdm-settings-modal {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 99999;
}

#qdm-settings-modal > .modal-content {
    background: #ffffff; 
    width: 92%; 
    max-width: 480px; 
    max-height: 85vh; 
    overflow-y: auto; 
    border-radius: 12px; 
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2); 
    padding: 20px; 
    position: relative; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: auto;
    box-sizing: border-box;
}

.qdm-modal-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid #e2e8f0; 
    padding-bottom: 12px; 
    margin-bottom: 16px;
}

.qdm-modal-title {
    margin: 0; 
    font-size: 16px; 
    font-weight: bold; 
    color: #0f172a; 
    display: flex; 
    align-items: center; 
    gap: 8px;
}

.qdm-modal-close-btn {
    background: none; 
    border: none; 
    font-size: 22px; 
    cursor: pointer; 
    color: #64748b;
    padding: 0;
    line-height: 1;
}

.qdm-modal-box-info {
    background: #f8fafc; 
    border: 1px solid #e2e8f0; 
    padding: 12px; 
    border-radius: 8px; 
    margin-bottom: 16px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

.qdm-modal-section {
    background: #f8fafc; 
    border: 1px solid #e2e8f0; 
    padding: 12px; 
    border-radius: 8px;
}

.qdm-input-label {
    display: block; 
    font-size: 12px; 
    font-weight: 700; 
    color: #1e293b; 
    margin-bottom: 6px;
}

.qdm-file-input, .qdm-text-input {
    width: 100%; 
    padding: 8px 10px; 
    border: 1px solid #cbd5e1; 
    border-radius: 6px; 
    box-sizing: border-box; 
    font-size: 12px;
    background: #ffffff;
}

.qdm-btn-submit {
    width: 100%; 
    color: white; 
    border: none; 
    padding: 9px; 
    border-radius: 6px; 
    font-size: 12px; 
    font-weight: bold; 
    cursor: pointer;
}

.qdm-btn-sky { background: #0284c7; }
.qdm-btn-teal { background: #0f766e; }
.qdm-btn-green { background: #16a34a; }
.qdm-btn-red { background: #ef4444; }