:root {
    --primary: #7C3AED;
    --primary-hover: #6D28D9;
    --accent: #10B981;
    --bg-dark: #050507;
    --bg-card: #0F0F13;
    --text-main: #F9FAFB;
    --text-muted: #9CA3AF;
    --border: rgba(255, 255, 255, 0.08);
    --glass: rgba(255, 255, 255, 0.03);
    --gradient: linear-gradient(90deg, #7C3AED, #EC4899);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.sb-modal-content {
    max-height: 90vh;
    overflow-y: auto;
}


#port-storePreviewGrid {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px; 
}

#port-storePreviewGrid::-webkit-scrollbar {
    width: 8px;
}

#port-storePreviewGrid::-webkit-scrollbar-track {
    background: transparent;
}

#port-storePreviewGrid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

#port-storePreviewGrid::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.35);
}


.video-link-preview {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 12px;
    background: #000;
    color: #fff;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
}

.dashboard-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.sidebar-header {
    padding: 0 20px 30px;
}

.brand-logo {
    width: 100px;
    filter: brightness(1.2);
    margin-left: 15px;
}

.nav-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    padding: 0 20px 10px;
}

.nav-item {
    width: 100%;
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    transition: 0.2s;
}

.nav-item:hover {
    background: #1a1a1a;
}

.nav-item.active {
    background: #1a1a1a;
    color: var(--primary);
    border-right: 2px solid var(--primary);
}


.sidebar-footer {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-main);
    padding: 0px 0px 40px 40px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.section-header h1 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 4px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.sb-table-container {
    margin-top: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow-y: hidden;
    overflow-x: auto;
}

.sb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.sb-table th {
    background: #191919;
    padding: 12px 20px;
    color: var(--text-muted);
    font-weight: 400;
    border-bottom: 1px solid var(--border-color);
}

.sb-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.uid-cell {
    font-family: monospace;
    font-size: 11px;
    color: var(--text-muted);
}

.sb-btn-danger {
    background: #ff4e4e;
    color: #fff;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 20px;
}

.nav-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.nav-item {
    display: flex;
    width: 100%;
}

.content-header {
    padding-top: 10px;
    padding-bottom: 10px;
    border: none;
}

.sb-modal {
    position: fixed;
    inset: 0;
    z-index: 999;
}

.sb-modal.hidden {
    display: none;
}

.sb-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.sb-modal-content {
    position: relative;
    background: #111;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 400px;
    max-width: calc(100vw - 40px);
    padding: 24px;
    margin: 10vh auto;
}

.sb-modal-content h2 {
    margin-bottom: 20px;
    font-size: 18px;
}

.sb-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 13px;
}

.sb-form input {
    background: #0f0f0f;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 10px;
    border-radius: 4px;
}

.sb-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.sb-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sb-modal.hidden {
    display: none;
}

.sb-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(2px);
}

.sb-modal-content {
    position: relative;
    background: #111;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 440px;
    padding: 32px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    animation: modalAppear 0.2s ease-out;
}

.sb-table input[type="text"]:focus {
    border-color: #a855f7 !important;
    background: #141414 !important;
}

.sb-table td {
    vertical-align: middle;
    padding: 15px 10px;
}

.settings-control-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    width: 100%;
}

.sb-input-table {
    background: #0f0f0f !important;
    border: 1px solid #333 !important;
    color: #fff !important;
    padding: 0 12px !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    height: 36px !important;
    width: 280px;
    box-sizing: border-box;
}

.btn-save-setting {
    height: 36px !important;
    padding: 0 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    font-size: 13px !important;
    cursor: pointer;
}

.sb-table td {
    padding: 16px 12px !important;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.sb-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--text-muted);
}

.sb-form input {
    background: #0a0a0a;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.sb-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.sb-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.settings-list {
    display: flex;
    flex-direction: column;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.setting-info h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.setting-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-save-setting {
    transition: all 0.2s ease;
}

.btn-save-setting.dirty {
    background: #f59e0b;
    color: #000;
}

.btn-save-setting.saved {
    background: #10b981;
    color: #fff;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.media-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.media-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
}

.media-preview-item img,
.media-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
}


.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

@media (max-width: 768px) {
    .dashboard-wrapper {
        flex-direction: column;
        height: auto;
        overflow-x: hidden;
    }

    body {
        overflow-y: auto;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 10px 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .sidebar-header {
        padding: 10px 20px;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 5px 15px;
        gap: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .nav-group {
        flex-direction: row;
        width: auto;
    }

    .nav-label {
        display: none;
    }

    .nav-item {
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 6px;
        border-right: none !important;
    }

    .nav-item.active {
        background: var(--glass);
        border-bottom: 2px solid var(--primary);
    }

    .sidebar-footer {
        display: none;
    }

    .main-content {
        padding: 20px 15px;
        width: 100%;
    }

    .section-header {
        flex-direction: column;
        gap: 15px;
    }

    .header-main-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-actions {
        display: flex;
        width: 100%;
        gap: 10px;
    }

    .header-actions button {
        flex: 1;
    }

    .sb-table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sb-table {
        min-width: 600px;
    }

    .sb-modal-content {
        width: 95%;
        margin: 20px auto;
        padding: 20px;
    }

    .sb-input-table {
        width: 150px !important;
    }

    .settings-control-group {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .section-header h1 {
        font-size: 20px;
    }

    .sb-btn-primary,
    .sb-btn-secondary {
        padding: 10px;
        font-size: 12px;
    }

}

