:root {
    --primary: #82c91e;
    --sidebar-bg: #3d3d3d;
    --sidebar-active: #4a4a4a;
    --bg-main: #f4f6f8;
    --text-blue: #82c91e;
    --border-grey: #e5e7eb;
}

.btn-create-qr,
.btn-download-pro {
    background: #97cc3a !important;
    color: white !important;
    border: none !important;
    padding: 12px 25px !important;
    border-radius: 4px !important;
    font-weight: 800 !important;
    font-size: 13px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    text-transform: uppercase !important;
    transition: all 0.3s cubic-bezier(0.445, 0.05, 0.55, 0.75) !important;
}

.btn-download-pro {
    margin-top: 10px !important;
}

.btn-create-qr:hover {
    background: #86b832 !important;
}

.btn-download-pro:hover {
    background: #a9d94b !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc;
    color: #1e293b;
    outline: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

option {
    color: #1e293b !important;
    background-color: #ffffff !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(130, 201, 30, 0.12), 0 4px 12px rgba(0, 0, 0, 0.05);
}

input::placeholder {
    color: #94a3b8;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-main);
    color: #1e293b;
    overflow-x: hidden;
}

.sidebar-backdrop {
    display: none;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

[dir="rtl"] {
    direction: rtl;
}

[dir="ltr"] {
    direction: ltr;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: #fff;
    position: fixed;
    left: 0;
    top: 60px;
    height: calc(100vh - 60px);
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-top {
    flex-shrink: 0;
}

.sidebar-folders-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.folders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 25px;
}

[dir="rtl"] .folders-header {
    padding-right: 0;
    padding-left: 25px;
}

.new-folder-btn {
    color: #82c91e;
    font-size: 9px;
    font-weight: 800;
    text-decoration: none;
    background: rgba(130, 201, 30, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    transition: 0.2s;
    letter-spacing: 0.5px;
}

.new-folder-btn:hover {
    background: rgba(130, 201, 30, 0.2);
    color: #94d82d;
}

.sidebar-middle {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.sidebar-bottom {
    flex-shrink: 0;
}

/* Sidebar Scrollbar */
.sidebar-middle::-webkit-scrollbar {
    width: 4px;
}

.sidebar-middle::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-middle::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar.collapsed {
    transform: translateX(-300px) !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

[dir="rtl"] .sidebar {
    left: auto !important;
    right: 0 !important;
}

[dir="rtl"] .sidebar.collapsed {
    transform: translateX(300px) !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.sidebar-mobile-close {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    /* Default for English: opposite of left sidebar */
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: white;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000001;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: scale(0.8) rotate(-45deg);
    opacity: 0;
}

[dir="rtl"] .sidebar-mobile-close {
    right: auto;
    left: 15px;
    /* For Arabic: opposite of right sidebar */
}

@media (max-width: 1024px) {
    body.sidebar-active .sidebar-mobile-close {
        display: flex;
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.sidebar-mobile-close:active {
    transform: scale(0.9);
}

.sidebar-mobile-close i {
    width: 18px;
    height: 18px;
    stroke-width: 2.5px;
}

.sidebar-search {
    padding: 20px 15px;
}

.search-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-box input {
    background: transparent !important;
    border: none !important;
    color: white !important;
    outline: none;
    font-size: 13px;
    width: 100%;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-nav {
    padding: 10px 0;
}

.nav-label {
    padding: 10px 25px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-item {
    padding: 8px 50px 8px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
    position: relative;
}

[dir="rtl"] .nav-item {
    padding: 8px 25px 8px 50px;
}

.nav-item:hover {
    background: var(--sidebar-active);
}

.nav-item.active {
    background: var(--sidebar-active);
    border-left: 3px solid var(--primary);
}

[dir="rtl"] .nav-item.active {
    border-left: none;
    border-right: 3px solid var(--primary);
}

.nav-item-wrapper:hover .btn-delete-folder {
    opacity: 1;
}

.btn-delete-folder {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 5px;
    opacity: 0;
    transition: all 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

[dir="rtl"] .btn-delete-folder {
    right: auto;
    left: 10px;
}

/* Only for touch devices where hover is not possible */
@media (hover: none) {
    .btn-delete-folder {
        opacity: 1 !important;
        position: relative;
        right: 0 !important;
        left: 0 !important;
        transform: none !important;
        margin-left: 10px;
    }

    .nav-item-wrapper {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-right: 15px;
    }

    [dir="rtl"] .nav-item-wrapper {
        padding-right: 0;
        padding-left: 15px;
    }
}

.btn-delete-folder:hover {
    color: #ef4444;
    transform: translateY(-50%) scale(1.1);
}

.nav-item i {
    width: 18px;
    height: 18px;
}

.nav-item .count-badge,
.nav-item .nav-count {
    margin-left: auto;
    margin-right: 15px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

[dir="rtl"] .nav-item .count-badge,
[dir="rtl"] .nav-item .nav-count {
    margin-left: 15px;
    margin-right: auto;
}

.nav-item.active .count-badge {
    color: var(--primary);
}

/* Live Sync Indicator */
.live-sync-container {
    padding: 15px 25px;
    position: relative;
}

.live-sync-line {
    height: 2px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    transition: all 0.3s;
}

.live-sync-label {
    font-size: 8px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 2px;
    margin-top: 5px;
    text-align: center;
}

.live-sync-line.refreshing {
    background: #82c91e;
    box-shadow: 0 0 15px rgba(130, 201, 30, 0.6);
    transform: scaleY(1.5);
}

/* Global Layout Structure */
.main-content {
    width: calc(100% - 250px);
    margin-left: 250px;
    padding: 30px 25px;
    background: var(--bg-main);
    min-height: 100vh;
    transition: all 0.3s ease;
}

[dir="rtl"] .main-content {
    margin-left: 0;
    margin-right: 250px;
}

.sidebar.collapsed~.main-content {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
}

[dir="rtl"] .sidebar.collapsed~.main-content {
    margin-right: 0 !important;
    margin-left: 0 !important;
    width: 100% !important;
}

@media (max-width: 1024px) {
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.4);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: 999990;
        animation: fadeIn 0.3s ease;
        pointer-events: none;
        /* Make it transparent to clicks by default */
    }

    body.sidebar-active .sidebar-backdrop {
        display: block;
        pointer-events: auto;
        /* Enable clicks only when active to allow closing */
    }

    .sidebar {
        position: fixed;
        left: 0;
        right: auto;
        z-index: 1000000;
        /* Increased z-index */
        width: 280px;
        background: var(--sidebar-bg) !important;
        display: flex !important;
        /* Changed from block to flex */
        flex-direction: column;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform: translateX(-300px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        /* Hide clicks when collapsed */
        box-shadow: none;
    }

    [dir="rtl"] .sidebar {
        left: auto;
        right: 0;
        transform: translateX(300px);
    }

    .sidebar.active {
        transform: translateX(0) !important;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        /* Enable clicks when open */
        box-shadow: 15px 0 30px rgba(0, 0, 0, 0.3);
    }

    [dir="rtl"] .sidebar.active {
        transform: translateX(0) !important;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        /* CRITICAL FIX: Enable clicks when open in RTL */
        box-shadow: -15px 0 30px rgba(0, 0, 0, 0.3);
    }

    /* Sidebar Overlay Backdrop - MOBILE ONLY */
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: 999990;
        /* Just below the sidebar */
        transition: opacity 0.3s ease;
    }

    body.sidebar-active .sidebar-backdrop {
        display: block !important;
    }

    body.sidebar-active {
        overflow: hidden;
    }

    body.sidebar-active .top-nav {
        transform: none !important;
    }

    .app-container {
        position: relative;
    }

    .main-content {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 15px 10px !important;
        /* Significantly reduced padding for mobile */
        min-height: auto !important;
    }

    .top-nav {
        position: fixed;
        left: 0;
        right: 0;
        z-index: 100000;
        /* Ensure it stays above everything, including backdrop */
    }
}

.top-header {
    height: 75px;
    background: white;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.btn-create-qr {
    background: #fff;
    border: 1px solid var(--border-grey);
    color: #333;
    padding: 10px 25px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-create-qr:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Original QR Card Style */
.qr-list {
    display: flex;
    flex-direction: column;
    gap: 35px;
    width: 100%;
    padding-bottom: 100px;
    /* Huge space to prevent fixed bar from ever touching cards */
}

.qr-card {
    background: white;
    border-radius: 12px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    border-left: 4px solid var(--primary);
    opacity: 0;
    transform: translateY(20px);
}

.qr-card.visible {
    animation: cardFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qr-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: var(--primary);
    z-index: 50;
}

.qr-card .select-col {
    width: 20px;
}

.qr-card .type-icon-col {
    width: 44px;
}

.qr-card .info-col {
    flex: 1;
    min-width: 0;
}

.qr-card .stats-col {
    width: 100px;
    padding: 0 15px;
    border-left: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
}

.qr-card .qr-preview-col {
    width: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-card .action-col {
    width: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 60px;
}

.th-container {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    transition: all 0.3s ease;
    padding: 4px;
}

.th-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.qr-card:hover .th-container {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.qr-card:hover {
    z-index: 5000;
    position: relative;
}

.type-icon-box {
    width: 44px;
    height: 44px;
    background: #f8fafc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.qr-card:hover .type-icon-box {
    background: #f0f9ff;
    transform: scale(1.05);
}

.type-label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    display: flex;
    gap: 10px;
}

.qr-url-link {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
    transition: 0.2s;
}

.meta-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}

.meta-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #64748b;
}

.meta-item i {
    width: 12px;
    height: 12px;
    opacity: 0.6;
    position: relative;
}

/* Link Group & Perfect Alignment */
.meta-link-group {
    display: flex;
    align-items: flex-start !important;
    gap: 10px;
    position: relative;
    padding-top: 2px;
}

/* The connector coming down from the icon area */
.meta-link-group::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 20px;
    width: 10px;
    height: 12px;
    border-left: 1.5px solid #cbd5e1;
    border-bottom: 1.5px solid #cbd5e1;
    border-bottom-left-radius: 4px;
    opacity: 0.8;
    pointer-events: none;
}

[dir="rtl"] .meta-link-group::after {
    left: auto;
    right: 5px;
    border-left: none;
    border-right: 1.5px solid #cbd5e1;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 4px;
}

.links-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
}

.short-link-text {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    font-size: 12px;
    line-height: 1.2;
}

.target-link-text {
    opacity: 0.6;
    font-size: 10px;
    color: #64748b;
    line-height: 1.2;
}

.stats-val-box {
    text-align: center;
    margin-bottom: 4px;
}

.stats-num {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
}

.stats-label {
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 700;
    color: #94a3b8;
    margin-top: 2px;
    display: block;
}

.details-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    padding: 6px;
    background: #f0fdf4;
    border-radius: 6px;
    transition: 0.2s;
}

.th-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.th-container canvas,
.th-container svg {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.qr-card .action-col {
    width: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 80px;
}

.btn-download-pro {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 140px;
    z-index: 2;
}

.qr-action-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
    z-index: 1;
    margin-bottom: 10px;
}

.qr-card:hover .btn-download-pro {
    transform: none;
}

.qr-card:hover .qr-action-row {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.btn-icon-sm {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
}

.btn-icon-sm i {
    width: 18px;
    height: 18px;
}

.btn-icon-sm:hover {
    color: var(--primary);
    background: #f0fdf4;
    border-color: #dcfce7;
}

@media (max-width: 1024px) {
    .qr-card {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .stats-col {
        border: none !important;
        padding: 15px 0 !important;
        border-top: 1px solid #f1f5f9 !important;
        border-bottom: 1px solid #f1f5f9 !important;
        width: 100% !important;
    }
}

.stats-num {
    font-size: 20px;
}

.qr-preview-col {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 5px 0;
}

.th-container {
    width: 60px;
    height: 60px;
    margin: 0 auto;
}

.action-col {
    width: 100%;
    min-height: auto;
    gap: 8px;
}

.btn-download-pro {
    padding: 8px;
    font-size: 13px;
}

.qr-action-row {
    margin-top: 5px;
    gap: 15px;
}

.qr-url-link {
    white-space: normal;
    text-align: left;
    word-break: break-all;
    font-size: 18px;
    line-height: 1.4;
}

[dir="rtl"] .qr-url-link {
    text-align: right;
}

/* Modal Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 95%;
    max-width: 1100px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
}

.wizard-step {
    display: none !important;
    min-height: 100%;
}

.wizard-step.active {
    display: block !important;
}

/* Wizard Styling */
.wizard-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 0;
    min-height: 500px;
}

.wizard-main {
    padding: 40px;
    border-right: 1px solid #f0f0f0;
}

[dir="rtl"] .wizard-main {
    border-right: none;
    border-left: 1px solid #f0f0f0;
}

.wizard-sidebar {
    padding: 40px;
    background: #f8fafc;
}

.section-divider {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 30px 0 20px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
}

.type-grid-pro {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.type-card-pro {
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    transition: 0.2s;
    background: #fff;
}

.type-card-pro:hover {
    border-color: var(--primary);
    background: #f0f9ff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Customize Step */
.customize-step {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.customize-header {
    padding: 20px 40px;
    border-bottom: 1px solid #f0f0f0;
}

.customize-header h2 {
    color: #0f3460;
    font-size: 22px;
    font-weight: 700;
}

.customize-body {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 0;
    overflow: hidden;
}

.customize-main {
    padding: 30px 40px;
    overflow-y: auto;
    border-right: 1px solid #f0f0f0;
}

[dir="rtl"] .customize-main {
    border-right: none;
    border-left: 1px solid #f0f0f0;
}

.customize-sidebar {
    padding: 40px 20px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section {
    margin-bottom: 35px;
}

.section h3 {
    font-size: 13px;
    font-weight: 800;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.item-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
}

.grid-item {
    width: 60px;
    height: 60px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    background: #fff;
    transition: all 0.2s;
    flex-shrink: 0;
}

.grid-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
    background: #f0f9ff;
}

.grid-item img {
    max-width: 100%;
    max-height: 100%;
}

.color-picker-row {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.color-field {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.color-field label {
    font-size: 10px;
    color: #999;
    margin-bottom: 4px;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid #ddd;
    position: absolute;
    right: 12px;
    top: 15px;
    cursor: pointer;
}

.customize-footer {
    padding: 20px 40px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-skip {
    border: 1px solid var(--primary);
    color: var(--primary);
    background: white;
    padding: 10px 30px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    text-transform: uppercase;
}

.btn-complete {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    text-transform: uppercase;
}

/*  Move Dropdown */
.folder-move-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    width: 180px;
    padding: 6px;
    margin-top: 5px;
    display: none;
    flex-direction: column;
}

.folder-move-item {
    padding: 10px 12px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    border-radius: 6px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

[dir="rtl"] .folder-move-item {
    text-align: right;
    direction: rtl;
}

.folder-move-item:hover {
    background: #f1f5f9;
    color: var(--primary);
}

/* Generic Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 5px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12), 0 5px 15px rgba(0, 0, 0, 0.05);
    z-index: 10000;
    width: 170px;
    display: none;
    flex-direction: column;
    padding: 8px;
}

.dropdown-menu.active {
    display: flex;
}

/* Bridge the gap to prevent mouseleave flickering */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
}

@media (min-width: 1025px) {
    .dropdown-menu {
        right: 0;
        top: 40px;
        margin-top: 5px;
        z-index: 10000;
    }

    [dir="rtl"] .dropdown-menu {
        right: auto;
        left: 0;
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    border-radius: 6px;
    transition: 0.2s;
}

[dir="rtl"] .dropdown-item {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .dropdown-menu {
    right: auto;
    left: 0;
}

.dropdown-item:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.dropdown-item i {
    width: 14px;
    height: 14px;
    color: #94a3b8;
}

.dropdown-item.delete:hover {
    background: #fef2f2;
    color: #ef4444;
}

.dropdown-item.delete:hover i {
    color: #ef4444;
}

.qr-type-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    text-align: left;
}

[dir="rtl"] .qr-type-card {
    text-align: right;
}

.qr-type-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.qr-type-card.active {
    border-color: #3b82f6;
    background: #eff6ff;
    border-width: 2px;
}

.qr-type-card i {
    width: 40px;
    height: 40px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    flex-shrink: 0;
}

.qr-type-card strong {
    display: block;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 2px;
}

.qr-type-card span {
    font-size: 11px;
    color: #000000;
    font-weight: 500;
}

/* Disabled/Soon Styles */
.qr-type-card.disabled-soon {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
    border-style: dashed;
    background: #e0dfdf94;
}

.qr-type-card.disabled-soon:hover {
    transform: none;
    border-color: #0000005e;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.soon-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ef4444;
    color: rgba(0, 0, 0, 0.336);
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[dir="rtl"] .soon-badge {
    right: auto;
    left: 10px;
}

.dropdown-item-pro {
    padding: 10px 12px;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    border-radius: 6px;
    transition: 0.2s;
}

.dropdown-item-pro:hover {
    background: #f8fafc;
    color: var(--primary);
}

.qr-title-display {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.meta-item a:hover {
    color: var(--primary) !important;
}

.nav-count {
    margin-left: auto;
    font-size: 11px;
    opacity: 0.7;
}

.custom-select-container {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 10px 15px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    display: none;
    z-index: 10;
    max-height: 250px;
    overflow-y: auto;
}

.custom-select-container.open .custom-select-options {
    display: block;
}

.custom-select-container.open .custom-select-trigger {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-select-container.open #move-folder-chevron {
    transform: rotate(180deg);
}

.custom-option {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
    color: #475569;
}

.custom-option:hover {
    background: #f8fafc;
}

.new-folder-opt {
    border-bottom: 1px solid #f1f5f9;
}

/* Top Navigation */
.top-nav {
    height: 70px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100000;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.top-nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.logo:hover {
    transform: scale(1.02);
}

.sidebar-toggle-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: var(--primary);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-toggle-btn:hover {
    background: #f0fdf4;
    border-color: var(--primary);
}

.qr-usage-count {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    background: #f8fafc;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #f1f5f9;
}

[dir="rtl"] .top-nav-left,
[dir="rtl"] .top-nav-right {
    flex-direction: row;
    /* Ensure row, not row-reverse because dir=rtl already flips them */
}

/* Language Dropdown */
.lang-custom-dropdown {
    position: relative;
}

.lang-btn {
    background: white;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    font-weight: 700;
    font-size: 11px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.lang-btn:hover {
    border-color: var(--primary);
    background: #f0fdf4;
}

.lang-menu {
    align-items: center;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 50px;
    display: none;
    z-index: 2000;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

[dir="rtl"] .lang-menu {
    right: auto;
    left: 0;
}

.lang-option {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
}

.lang-option:hover {
    background: #f8fafc;
    color: var(--primary);
}

.flag-icon {
    display: inline-block;
    width: 20px;
    height: 14px;
    background-size: cover;
    background-position: center;
    border-radius: 2px;
}

.flag-us {
    background-image: url('https://flagcdn.com/w40/us.png');
}

.flag-lb {
    background-image: url('https://flagcdn.com/w40/lb.png');
}

/* Account Dropdown */
.account-dropdown-container {
    position: relative;
}

#account-menu-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    padding: 6px 15px;
    border-radius: 50px;
    border: 1px solid #f1f5f9;
    cursor: pointer;
    transition: 0.2s;
    outline: none;
}

#account-dropdown.dropdown-menu {
    display: none;
    position: absolute;
    top: 45px;
    right: 0;
    width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    z-index: 2000;
    overflow: hidden;
    padding: 0;
}

[dir="rtl"] #account-dropdown.dropdown-menu {
    right: auto;
    left: 0;
}

.dropdown-links .dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    text-decoration: none;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    transition: 0.2s;
    border-radius: 0;
}

.dropdown-links .dropdown-item:hover {
    background: #f8fafc;
    color: var(--primary);
}

.dropdown-links .dropdown-item i {
    width: 16px;
    height: 16px;
    color: #94a3b8;
}

.dropdown-links .dropdown-item:hover i {
    color: var(--primary);
}

/* SaaS Sidebar Sections */
.account-section {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px 0;
    background: rgba(0, 0, 0, 0.1);
}

.plan-progress-container {
    padding: 10px 25px;
}

.plan-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

.plan-bar-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.plan-bar-fill {
    height: 100%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    transition: width 0.3s ease;
}

.upgrade-link {
    display: block;
    margin-top: 12px;
    font-size: 10px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.count-badge {
    background: #82c91e !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    color: #000 !important;
    font-weight: 800 !important;
    margin-left: auto !important;
    display: inline-block !important;
    min-width: 20px !important;
    text-align: center !important;
}

[dir="rtl"] .count-badge {
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    .logo span {
        display: none;
    }

    .top-nav {
        padding: 0 10px !important;
    }

    .qr-usage-count {
        display: none;
    }
}

/* Analytics & Details Page Specific Styles */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.stat-label {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    margin-top: 40px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-group {
    display: flex;
    gap: 10px;
}

.btn-outline {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.btn-outline:hover {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(130, 201, 30, 0.1);
}

.btn-group {
    display: flex;
    gap: 12px;
    padding: 5px;
    background: #f1f5f9;
    border-radius: 18px;
    width: fit-content;
}

.btn-group .btn-outline {
    border: none;
    background: transparent;
    box-shadow: none;
}

.btn-group .btn-outline:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.charts-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.chart-box {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    height: 350px;
}

.chart-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    color: #1e3a8a;
    display: flex;
    justify-content: space-between;
}

.geo-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.data-list-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.data-row {
    display: grid;
    grid-template-columns: 30px 1fr 60px 60px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    align-items: center;
}

.data-row:last-child {
    border: none;
}

.data-rank {
    color: #64748b;
    font-weight: 700;
}

.data-name {
    font-weight: 600;
}

.data-val {
    text-align: right;
    font-weight: 700;
}

.data-pct {
    text-align: right;
    color: #64748b;
    font-weight: 600;
}

.chart-legend {
    position: absolute;
    top: 25px;
    right: 25px;
    display: flex;
    gap: 10px;
    font-size: 9px;
    font-weight: 700;
}

.os-bar-container {
    margin-top: 15px;
}

.os-item {
    margin-bottom: 15px;
}

.os-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}

.os-progress-bg {
    background: #fee2e2;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.os-progress-fill {
    background: #f87171;
    height: 100%;
    border-radius: 6px;
}

/* Short URL Box Styles */
.short-url-card {
    background: #f0f9ff;
    border: 1px solid #e0f2fe;
    border-radius: 12px;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 15px 0;
    width: 100%;
    max-width: 460px;
}

.short-url-text {
    font-size: 15px;
    font-weight: 700;
    color: #0369a1;
    text-align: center;
    flex: 1;
}

.short-url-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.action-icon {
    color: #0ea5e9;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
}

.action-icon:hover {
    color: #0369a1;
    transform: scale(1.1);
}

/* Details Dropdown */
.details-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 100;
    min-width: 140px;
    padding: 8px 0;
    margin-top: 5px;
}

.details-dropdown.active {
    display: block;
}

.dropdown-link {
    display: block;
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    cursor: pointer;
}

.dropdown-link:hover {
    background: #f8fafc;
    color: var(--primary);
}

.editable-stat {
    transition: 0.2s;
    border-radius: 8px;
    padding: 5px;
    margin: -5px;
    cursor: pointer;
}

.editable-stat:hover {
    background: #f0f9ff;
}

.filter-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Enhanced Modal System */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    width: 100%;
    max-width: 480px;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h2 {
    font-size: 26px;
    color: #1e3a8a;
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.modal-description {
    color: #475569;
    font-size: 15px;
    margin-bottom: 35px;
    line-height: 1.6;
}

.floating-input-group {
    position: relative;
    margin-bottom: 40px;
}

.floating-input {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 18px;
    outline: none;
    color: #1e293b;
    transition: all 0.2s;
    box-sizing: border-box;
}

.floating-input:focus {
    border-color: #00c2ff;
    box-shadow: 0 0 0 4px rgba(0, 194, 255, 0.1);
}

.floating-label {
    position: absolute;
    top: -10px;
    left: 15px;
    background: white;
    padding: 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: #1e3a8a;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 10px;
}

.btn-cancel {
    background: white;
    border: 2px solid #00c2ff;
    color: #00c2ff;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
}

.btn-apply {
    background: #00c2ff;
    border: none;
    color: white;
    padding: 14px 40px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 194, 255, 0.3);
    transition: all 0.2s;
}

/* Flatpickr Custom Styling */
.flatpickr-calendar {
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: none;
    padding: 5px;
}

.flatpickr-day.selected {
    background: #00c2ff;
    border-color: #00c2ff;
}

.flatpickr-months .flatpickr-month {
    background: #00c2ff;
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 10px 0;
}

.flatpickr-weekday {
    color: white;
    background: #00c2ff;
    font-weight: 700;
}

/* Status Toggle */
.status-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 8px 15px;
    border-radius: 30px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: 0.2s;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.active {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.status-dot.paused {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.status-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

/* RTL Adjustments for Details & Analytics */
[dir="rtl"] .chart-legend {
    right: auto !important;
    left: 60px !important;
    flex-direction: row-reverse !important;
}

[dir="rtl"] .chart-title {
    text-align: right;
}

[dir="rtl"] .stat-card {
    text-align: right;
}

[dir="rtl"] .section-title {
    text-align: right;
}

[dir="rtl"] .stat-label {
    justify-content: flex-start;
    gap: 10px;
}

[dir="rtl"] .data-row {
    grid-template-columns: 30px 1fr 60px 60px;
    text-align: right;
}

[dir="rtl"] .data-val,
[dir="rtl"] .data-pct {
    text-align: left;
}

[dir="rtl"] .btn-outline i {
    margin-right: 0;
    margin-left: 6px;
}

[dir="rtl"] .btn-outline i[data-lucide="arrow-left"] {
    transform: rotate(180deg);
}

/* Removed redundant row-reverse that flipped logo/toggle */
[dir="rtl"] .details-dropdown {
    right: auto;
    left: 0;
}

/* Settings & Billing Shared Styles */
.tabs-header {
    display: flex;
    gap: 40px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 40px;
    flex-wrap: wrap;
    justify-content: flex-start;
    background: transparent;
}

.tab-link {
    padding: 15px 0;
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: 0.2s;
    white-space: nowrap;
}

.tab-link:hover {
    color: var(--text-main);
}

.tab-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.settings-card,
.card {
    background: white;
    border-radius: 24px;
    padding: 30px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (max-width: 768px) {

    .settings-card,
    .card {
        padding: 20px;
        border-radius: 16px;
    }
}

.settings-card:hover,
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.08);
}

.section-title {
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::after {
    content: "";
    height: 1px;
    flex: 1;
    background: linear-gradient(to right, #f1f5f9, transparent);
}

[dir="rtl"] .section-title::after {
    background: linear-gradient(to left, #f1f5f9, transparent);
}

.section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

@media (max-width: 768px) {
    .section-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f8fafc;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

.info-value {
    font-size: 13px;
    color: #1e293b;
    font-weight: 700;
    background: #f8fafc;
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f8fafc;
}

.form-label {
    width: 220px;
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    flex-shrink: 0;
}

.edit-link {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 800;
    margin-left: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edit-link:hover {
    text-decoration: underline;
}

.btn-save {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(130, 201, 30, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-save:hover {
    background: #74b816;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(130, 201, 30, 0.35);
}

.btn-save.active {
    background: var(--primary) !important;
    opacity: 1 !important;
}

.text-input,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
select {
    width: 100%;
    padding: 11px 16px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ts-control {
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 15px !important;
    background-color: white !important;
    box-shadow: none !important;
    min-height: 45px;
    display: flex;
    align-items: center;
}

.ts-control input {
    font-size: 15px !important;
}

.ts-dropdown {
    border-radius: 10px !important;
    margin-top: 5px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    z-index: 1000 !important;
}

.ts-dropdown .active {
    background-color: #f8fafc !important;
    color: var(--primary) !important;
}

.ts-dropdown .option {
    padding: 10px 14px !important;
}

.text-input:focus,
input:focus,
select:focus,
.ts-wrapper.focus .ts-control {
    background: white;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(130, 201, 30, 0.1) !important;
}

@media (max-width: 768px) {
    .section-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .form-label {
        width: 100%;
    }

    .main-content {
        padding: 15px !important;
        margin-top: 20px;
    }

    .app-container {
        padding: 0 10px;
    }

    .card {
        padding: 20px !important;
    }

    .tabs-header {
        margin-left: -15px;
        margin-right: -15px;
        padding-left: 15px;
        padding-right: 15px;
    }
}

.billing-grid {
    display: grid;
    grid-template-areas: "details info";
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.details-card {
    grid-area: details;
}

.info-card {
    grid-area: info;
}

@media (max-width: 992px) {
    .billing-grid {
        grid-template-areas: "info" "details";
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.sub-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.inner-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 480px) {
    .inner-grid {
        grid-template-columns: 1fr;
    }
}

.stat-box {
    background: #f8fafc;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.stat-label {
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
}

.sub-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #f1f5f9;
    position: relative;
}

.sub-label {
    font-size: 12px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.plan-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin-bottom: 15px;
}

.plan-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}

.plan-cycle {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    margin-left: 8px;
}

.btn-upgrade {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    transition: 0.2s;
}

.btn-upgrade:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(130, 201, 30, 0.2);
}

.btn-cancel {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 5px;
}

.btn-cancel:hover {
    text-decoration: underline;
}

.payment-method {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.card-brand {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-expiry {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.address-text {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
}

.history-title {
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
    margin: 40px 0 20px;
}

.table-container {
    background: white;
    border-radius: 24px;
    border: 1px solid #f1f5f9;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .table-container table {
        min-width: 800px;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    background: #f8fafc;
    padding: 18px 25px;
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    border-bottom: 1px solid #f1f5f9;
}

td {
    padding: 20px 25px;
    font-size: 14px;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
}

tr:last-child td {
    border-bottom: none;
}

.status-paid {
    background: #f0fdf4;
    color: #166534;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
}

.status-pending {
    background: #fffbeb;
    color: #92400e;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
}

.inv-number {
    font-weight: 700;
    color: #1e293b;
}

.inv-plan {
    color: #64748b;
    font-weight: 600;
}

.inv-date {
    color: #64748b;
}

.inv-total {
    font-weight: 800;
    color: #1e293b;
}

.btn-download {
    color: var(--primary);
    cursor: pointer;
    transition: 0.2s;
}

.btn-download:hover {
    transform: scale(1.1);
}

[dir="rtl"] th {
    text-align: right;
}

[dir="rtl"] .plan-cycle {
    margin-left: 0;
    margin-right: 8px;
}

[dir="rtl"] .edit-link {
    margin-left: 0;
    margin-right: 15px;
}

[dir="rtl"] .form-row {
    direction: rtl;
}

/* Pricing Plans Styles */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.price-card {
    background: white;
    border-radius: 24px;
    padding: 40px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
    transition: 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.price-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.price-card.popular {
    border: 2px solid var(--primary);
}

.price-card .badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 15px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    z-index: 10;
}

.plan-name {
    font-size: 14px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 15px;
    text-align: center;
}

.price {
    text-align: center;
    margin-bottom: 30px;
}

.price h2 {
    font-size: 48px;
    font-weight: 800;
    color: #1e293b;
}

.price span {
    font-size: 16px;
    color: #94a3b8;
    font-weight: 500;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
    flex: 1;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

.feature-list i {
    color: var(--primary);
    width: 18px;
}

.btn-choose {
    display: block;
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    font-weight: 800;
    text-decoration: none;
    text-align: center;
    transition: 0.3s;
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

.save-badge {
    background: #fef2f2;
    color: #ef4444;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
}

.countdown-box {
    background: #f8fafc;
    padding: 20px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    border: 1px solid #f1f5f9;
}

.cd-item {
    text-align: center;
}

.cd-num {
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
    display: block;
}

.cd-lab {
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
}

[dir="rtl"] .price-card .badge {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

[dir="rtl"] .toggle-container {
    flex-direction: row-reverse;
}

/* Team & API Styles */
.team-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.team-table th {
    text-align: left;
    font-size: 10px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    padding: 15px 20px;
    border-bottom: 1px solid #f1f5f9;
    letter-spacing: 1px;
}

.team-table td {
    padding: 18px 20px;
    font-size: 13px;
    border-bottom: 1px solid #f8fafc;
    color: #1e293b;
    font-weight: 500;
}

.team-table tr:hover td {
    background: #fcfdfe;
}

.api-key-box {
    background: #f8fafc;
    padding: 20px;
    border-radius: 16px;
    font-family: monospace;
    font-size: 13px;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    word-break: break-all;
}

.role-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    background: #f1f5f9;
    color: #64748b;
}

.btn-add {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-add:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(130, 201, 30, 0.2);
    transform: translateY(-1px);
}

.help-box {
    background: #f8fafc;
    padding: 25px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.help-box h3 {
    font-size: 14px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.help-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-box li {
    margin-bottom: 12px;
}

.help-box a {
    color: #64748b;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.help-box a:hover {
    color: var(--primary);
}

[dir="rtl"] .team-table th {
    text-align: right;
}

@media (max-width: 1024px) {

    .billing-grid,
    .section-grid,
    [style*="display:grid"] {
        grid-template-columns: 1fr !important;
        grid-template-areas: none !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }

    .help-box {
        margin-top: 20px;
        width: 100% !important;
    }

    .api-key-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .api-key-box code {
        font-size: 11px;
    }

    .team-table-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .team-table {
        min-width: 500px;
    }
}


/* Member Management Styles */
.member-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.team-table-container {
    width: 100%;
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.team-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.team-table th {
    background: #f8fafc;
    padding: 12px 20px;
    text-align: left;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    font-size: 11px;
    border-bottom: 1px solid #e2e8f0;
}

[dir="rtl"] .team-table th {
    text-align: right;
}

.team-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.team-table tr:last-child td {
    border-bottom: none;
}

.team-table tr.owner-row {
    background: #f0fdf4;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 14px;
}

.owner-row .user-avatar {
    background: #16a34a;
    color: white;
}

.user-name-email {
    display: flex;
    flex-direction: column;
}

.user-email {
    font-weight: 700;
    color: #1e293b;
}

.user-label {
    font-size: 12px;
    color: #94a3b8;
}

.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.role-badge.owner {
    background: #dcfce7;
    color: #166534;
}

.role-badge.full {
    background: #f0fdf4;
    color: #166534;
}

.role-badge.limited {
    background: #fff7ed;
    color: #9a3412;
}

.role-select {
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    outline: none;
    cursor: pointer;
    background: white;
    width: auto;
    min-width: 120px;
}

.member-email {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.member-role {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-remove {
    background: #fef2f2;
    color: #ef4444;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background: #ef4444;
    color: white;
}

.btn-invite {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-invite:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(130, 201, 30, 0.2);
}

@media (max-width: 768px) {
    .member-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .member-row>div:last-child {
        width: 100%;
        justify-content: space-between;
        display: flex;
        gap: 10px;
    }
}

.role-select {
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Wizard Step Layouts */
.step-1-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    min-height: 100%;
}

.dynamic-types-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.static-types-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.qr-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.color-pickers-grid {
    display: flex;
    gap: 15px;
}

.customize-footer {
    padding: 20px 40px;
    background: white;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .step-1-layout {
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important;
    }

    .customize-body {
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important;
    }

    .customize-main,
    .step-1-main {
        padding: 20px !important;
        height: auto !important;
        overflow: visible !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .grid-wizard {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, 55px) !important;
        justify-content: start !important;
        gap: 12px !important;
    }

    .grid-wizard .grid-item {
        width: 55px !important;
        height: 55px !important;
    }

    .step-1-sidebar,
    .customize-sidebar {
        border-left: none !important;
        border-top: 1px solid #e2e8f0;
        padding: 30px 20px !important;
        height: auto !important;
        order: -1;
        /* Puts the preview at the top */
    }

    [dir="rtl"] .step-1-sidebar,
    [dir="rtl"] .customize-sidebar {
        border-right: none !important;
    }

    .dynamic-types-grid,
    .static-types-grid,
    .qr-details-grid {
        grid-template-columns: 1fr !important;
    }

    .color-pickers-grid {
        flex-direction: column;
    }

    .customize-footer {
        display: none !important;
    }

    .mobile-complete-btn {
        display: flex !important;
    }

    .mobile-template-check {
        display: flex !important;
    }

    .desktop-title {
        display: none !important;
    }

    .customize-header {
        padding: 15px 20px !important;
    }

    .modal-content {
        height: auto !important;
        max-height: 90vh !important;
        border-radius: 24px !important;
        width: 90% !important;
        max-width: 400px !important;
        margin: 0 auto !important;
    }

    .modal-overlay .modal-content {
        height: auto !important;
        margin: auto !important;
    }

    /* Dashboard & QR List Responsiveness (Cards only) */

    .qr-card {
        display: grid !important;
        grid-template-columns: 40px 60px 1fr !important;
        grid-template-areas:
            "preview preview preview"
            "select icon info"
            "stats stats stats"
            "action action action" !important;
        align-items: stretch !important;
        padding: 0 !important;
        gap: 0 !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        background: #ffffff !important;
        border: 2px solid #97cc3a !important;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05) !important;
        margin-bottom: 25px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .qr-card .select-col {
        grid-area: select;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding-top: 35px;
        width: 100% !important;
    }

    .qr-card .type-icon-col {
        grid-area: icon;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding-top: 20px;
        width: 100% !important;
    }

    .qr-preview-col {
        grid-area: preview;
        background: #f8fafc;
        padding: 25px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        border-bottom: 1px solid #f1f5f9;
        margin-bottom: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .th-container {
        width: 140px !important;
        height: 140px !important;
        background: white;
        border-radius: 12px;
        padding: 10px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08) !important;
        border: 1px solid #ffffff;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .info-col {
        grid-area: info;
        padding: 10px 15px 10px 0 !important;
        text-align: left;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    [dir="rtl"] .info-col {
        padding: 20px 0 20px 15px !important;
        text-align: right;
    }

    .qr-url-link {
        font-size: 18px !important;
        word-break: break-all;
    }

    .meta-grid-layout {
        width: calc(100% + 100px) !important;
        margin-left: -100px !important;
        box-sizing: border-box !important;
        padding: 15px 15px 0 15px !important;
        display: flex !important;
        flex-direction: column-reverse !important;
        gap: 15px !important;
    }

    [dir="rtl"] .meta-grid-layout {
        margin-left: 0 !important;
        margin-right: -100px !important;
        padding: 10px 15px 0 15px !important;
    }

    .meta-grid-layout>.meta-stack:first-child {
        order: 2;
        /* Move Folder/Date below Links */
        flex-direction: row !important;
        /* Side-by-side */
        flex-wrap: wrap;
        gap: 15px !important;
        border-top: 1px solid #f1f5f9;
        padding-top: 8px;
    }

    .meta-grid-layout>.meta-stack:last-child {
        order: 1;
        /* Links on top */
    }

    .stats-col {
        grid-area: stats;
        border: none !important;
        border-top: 1px dashed #e2e8f0 !important;
        padding: 15px !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        box-sizing: border-box !important;
    }

    .action-col {
        grid-area: action;
        background: #ffffff !important;
        padding: 0 !important;
        border-top: 1px dashed #97cc3a !important;
        display: flex !important;
        flex-direction: column-reverse !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin-top: 0 !important;
    }

    .qr-action-row {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        gap: 35px !important;
        padding: 0px 0 !important;
        background: #ffffff !important;
        border-top: none !important;
    }

    .btn-download-pro {
        width: 100% !important;
        max-width: none !important;
        height: 55px;
        font-size: 14px !important;
        border-radius: 0 !important;
        justify-content: center;
        margin: 0 !important;
        border: none !important;
        border-top: 1px dashed #97cc3a !important;
        background: #97cc3a !important;
        color: white !important;
        transition: none !important;
        transform: none !important;
        position: relative;
        z-index: 10;
        display: flex !important;
        align-items: center;
    }

    .qr-card:hover .btn-download-pro {
        transform: none !important;
    }

    .btn-download-pro:hover {
        transform: none !important;
        background: #97cc3a !important;
    }

    .btn-icon-sm {
        width: 40px !important;
        height: 40px !important;
    }

    .dropdown-menu:not(#account-dropdown) {
        top: auto !important;
        bottom: 100% !important;
        right: 0;
        margin-top: 0 !important;
        margin-bottom: 10px !important;
        box-shadow: 0 -15px 35px rgba(0, 0, 0, 0.15) !important;
        display: none;
    }

    #account-dropdown.dropdown-menu {
        top: 60px !important;
        bottom: auto !important;
        display: none;
    }

    .dropdown-menu.active {
        display: flex !important;
    }

    .dropdown-menu::before {
        content: '';
        position: absolute;
        bottom: -15px;
        top: auto;
        left: 0;
        right: 0;
        height: 15px;
        background: transparent;
    }

    [dir="rtl"] .dropdown-menu {
        right: auto !important;
        left: 0 !important;
    }

    /* Top Nav tweaks */
    .nav-user-name,
    .nav-divider,
    .qr-usage-count {
        display: none !important;
    }
}

/* Premium Modal Design */
.modal {
    backdrop-filter: blur(8px);
    background: rgba(15, 23, 42, 0.4) !important;
    transition: all 0.3s ease;
    z-index: 100000 !important;
}

.modal-content-ready {
    max-width: 480px !important;
    padding: 50px 40px 40px !important;
    text-align: center;
    border-radius: 32px !important;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.15) !important;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f1f5f9;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: rotate(90deg);
}

.success-icon-wrapper {
    width: 70px;
    height: 70px;
    background: rgba(151, 204, 58, 0.1);
    color: #97cc3a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success-icon-wrapper i {
    width: 40px;
    height: 40px;
}

.modal-ready-title {
    font-size: 26px !important;
    color: #1e293b !important;
    margin-bottom: 30px !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px;
}

.qr-preview-container {
    width: 280px;
    height: 280px;
    margin: 0 auto 40px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 0;
    border: 1px solid #f1f5f9;
    overflow: hidden;
}

.qr-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.download-btn-group {
    display: flex;
    width: 100%;
    border-radius: 20px;
    overflow: visible;
    position: relative;
    box-shadow: 0 10px 25px rgba(151, 204, 58, 0.2);
}

.download-btn-main {
    flex: 1;
    background: linear-gradient(135deg, #97cc3a 0%, #82c91e 100%);
    color: white;
    border: none;
    padding: 20px 30px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 20px 0 0 20px;
    transition: all 0.3s;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.download-btn-arrow {
    background: #82c91e;
    color: white;
    border: none;
    padding: 0 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    border-radius: 0 20px 20px 0;
    transition: all 0.3s;
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

[dir="rtl"] .download-btn-main {
    border-radius: 0 20px 20px 0;
}

[dir="rtl"] .download-btn-arrow {
    border-radius: 20px 0 0 20px;
    border-left: none;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.download-btn-main:hover,
.download-btn-arrow:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
}

.format-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 900;
}

.format-dropdown {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    display: none;
    padding: 10px;
    z-index: 1000;
    border: 1px solid #f1f5f9;
}

.format-item {
    padding: 15px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    color: #475569;
    transition: 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.format-item:hover {
    background: #f8fafc;
    color: #97cc3a;
}

.format-item i {
    width: 16px;
    opacity: 0.5;
}

/* Global Toast Styling */
#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-msg {
    background: #ffffff;
    color: #1e293b;
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #82c91e;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
    font-weight: 600;
    min-width: 250px;
}

.toast-msg.active {
    transform: translateX(0);
}

.toast-msg.error {
    border-left-color: #ef4444;
}

.toast-msg i {
    font-size: 20px;
}

[dir="rtl"] #toast-container {
    right: auto;
    left: 20px;
}

[dir="rtl"] .toast-msg {
    border-left: none;
    border-right: 4px solid #82c91e;
    transform: translateX(-120%);
}

[dir="rtl"] .toast-msg.active {
    transform: translateX(0);
}

[dir="rtl"] .toast-msg.error {
    border-right-color: #ef4444;
}

/* Mobile styles for dashboard buttons */
/* Modern Premium Pagination */
.main-content {
    flex: 1;
    margin-left: 250px;
    /* Sidebar width */
    min-height: 100vh;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
}

[dir="rtl"] .main-content {
    margin-left: 0;
    margin-right: 250px;
}

@media (max-width: 1024px) {
    .main-content {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100%;
    }
}

.pagination-footer-spacer {
    height: 100px;
    width: 100%;
    pointer-events: none;
}

.pagination-container {
    padding: 15px 30px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.1);
    width: calc(100% - 250px);
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 1000;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

[dir="rtl"] .pagination-container {
    right: auto;
    left: 0;
}

.pagination-container.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

@media (max-width: 1024px) {
    .pagination-container {
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        padding: 15px 10px !important;
    }

    .pagination-footer-spacer {
        height: 100px;
        /* Even more space on mobile */
    }
}

.pagination-bottom-row {
    display: contents;
    /* Effectively removes this wrapper on desktop for flex-between */
}

.pagination-left {
    display: flex;
    align-items: center;
    gap: 12px;
    order: 1;
    flex: 1;
    justify-content: flex-start;
    white-space: nowrap;
}

.pagination-left span {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

.pagination-left select {
    appearance: none;
    background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
    border: 1px solid #e2e8f0;
    padding: 6px 30px 6px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 75px;
    outline: none;
}

[dir="rtl"] .pagination-left select {
    background-position: left 10px center;
    padding: 6px 12px 6px 30px;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 8px;
    order: 2;
    flex: 1;
    justify-content: center;
}

.pagination-pages .pag-btn {
    min-width: 36px;
    height: 36px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    font-weight: 700;
    font-size: 13px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pagination-pages .pag-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(130, 201, 30, 0.05);
}

.pagination-pages .pag-btn.active {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(130, 201, 30, 0.2);
}

.pagination-pages .pag-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f8fafc;
}

.pagination-info {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    order: 3;
    flex: 1;
    text-align: right;
}

[dir="rtl"] .pagination-info {
    text-align: left;
}

@media (max-width: 768px) {
    .pagination-container {
        display: flex !important;
        flex-direction: column !important;
        padding: 20px 10px !important;
        gap: 15px !important;
    }

    .pagination-pages {
        order: 1 !important;
        /* First row */
        background: #f1f5f9;
        padding: 5px;
        border-radius: 16px;
        gap: 4px !important;
        display: flex !important;
        flex-direction: row !important;
        width: fit-content !important;
        margin: 0 auto;
    }

    .pagination-bottom-row {
        order: 2 !important;
        /* Second row */
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 10px !important;
        background: #f8fafc;
        padding: 8px 15px !important;
        border-radius: 20px;
        width: fit-content !important;
        margin: 0 auto;
    }

    .pagination-left {
        gap: 5px !important;
        flex: none !important;
        display: flex !important;
        align-items: center !important;
    }

    .pagination-left span {
        font-size: 11px !important;
        white-space: nowrap !important;
    }

    .pagination-left select {
        padding: 4px 22px 4px 8px !important;
        font-size: 12px !important;
        min-width: 65px !important;
        max-width: 80px !important;
    }

    .pagination-info {
        font-size: 11px !important;
        opacity: 0.8 !important;
        border-left: 1px solid #cbd5e1;
        padding-left: 10px !important;
        white-space: nowrap !important;
        flex: none !important;
    }

    [dir="rtl"] .pagination-info {
        border-left: none;
        border-right: 1px solid #cbd5e1;
        padding-left: 0 !important;
        padding-right: 10px !important;
    }

    .pagination-pages .pag-btn {
        min-width: 32px !important;
        height: 32px !important;
        border-radius: 8px !important;
        font-size: 12px !important;
    }

    .btn-create-qr span {
        display: none !important;
    }

    .btn-create-qr {
        padding: 10px !important;
        min-width: 44px !important;
        justify-content: center !important;
        margin-right: 0 !important;
    }

    .top-nav-right {
        gap: 8px !important;
    }
}

.pagination-pages .pag-btn i {
    width: 18px;
    height: 18px;
}

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999;
    transition: opacity 0.5s ease;
}

.page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.qr-loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.qr-loader-icon {
    position: relative;
    width: 80px;
    height: 80px;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: qrPulse 2s infinite ease-in-out;
}

.qr-loader-icon i {
    width: 100% !important;
    height: 100% !important;
}

.scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
    animation: scanLine 2s infinite linear;
}

.lucide-x-twitter {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: currentColor;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932 6.064-6.932zm-1.292 19.494h2.039L6.486 3.24H4.298l13.311 17.407z"/></svg>') no-repeat center;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932 6.064-6.932zm-1.292 19.494h2.039L6.486 3.24H4.298l13.311 17.407z"/></svg>') no-repeat center;
    mask-size: contain;
    -webkit-mask-size: contain;
    vertical-align: middle;
}

@keyframes qrPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes scanLine {
    0% {
        top: 0;
    }

    50% {
        top: 100%;
    }

    100% {
        top: 0;
    }
}

.loader-dots {
    display: flex;
    gap: 6px;
}

.loader-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.4;
    animation: dotPulse 1.5s infinite ease-in-out;
}

.loader-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.4;
    }

    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* --- Skeleton Loading Animation --- */
@keyframes skeleton-loading {
    0% {
        background-color: #f3f4f6;
    }

    50% {
        background-color: #e5e7eb;
    }

    100% {
        background-color: #f3f4f6;
    }
}

.skeleton {
    animation: skeleton-loading 1.5s infinite ease-in-out;
    border-radius: 8px;
    background: #f3f4f6;
}

.skeleton-card {
    height: 120px;
    margin-bottom: 15px;
    border-radius: 12px;
    background: white;
    padding: 15px;
    display: flex;
    gap: 20px;
    align-items: center;
    border: 1px solid #f1f5f9;
}

.skeleton-select {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
}

.skeleton-content {
    flex: 1;
}

.skeleton-title {
    width: 60%;
    height: 20px;
    margin-bottom: 10px;
}

.skeleton-text {
    width: 40%;
    height: 12px;
    margin-bottom: 6px;
}

.skeleton-stats {
    width: 100px;
    height: 50px;
    border-radius: 12px;
}

.skeleton-preview {
    width: 100px;
    height: 100px;
    border-radius: 12px;
}

.skeleton-action {
    width: 120px;
    height: 40px;
    border-radius: 8px;
}

/* Lazy Load Fade-in */
.lazy-image {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.lazy-image.loaded {
    opacity: 1;
}

.th-container {
    background: #f8fafc;
    position: relative;
    overflow: hidden;
}

.th-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: placeholder-glow 2s infinite;
}

@keyframes placeholder-glow {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.spinning {
    animation: rotate 1.5s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}
.status-alert-bar {
    background: #fffcf0;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.05);
}
.alert-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.alert-icon {
    color: #d97706;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.alert-text {
    color: #92400e;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}
.alert-btn {
    background: #d97706;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(217, 119, 6, 0.2);
}
.alert-btn:hover {
    background: #b45309;
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(217, 119, 6, 0.3);
}
@media (max-width: 640px) {
    .status-alert-bar {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    .alert-btn {
        width: 100%;
        text-align: center;
    }
}
