:root {
    --primary: #82c91e;
    --sidebar-bg: #3d3d3d;
    --sidebar-active: #4a4a4a;
    --bg-main: #f4f6f8;
    --text-blue: #82c91e;
    --border-grey: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-main);
    color: #1e293b;
}

.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;
}

.sidebar.collapsed {
    transform: translateX(-250px);
}

[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
}

[dir="rtl"] .sidebar.collapsed {
    transform: translateX(250px);
}

.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: none;
    border: none;
    color: white;
    outline: none;
    font-size: 13px;
    width: 100%;
}

.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: 12px 50px 12px 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: 12px 25px 12px 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;
}

.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;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    [dir="rtl"] .sidebar {
        transform: translateX(100%);
    }

    .main-content {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 20px;
    }
}

.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;
}

/* QR List & Cards */
.qr-list {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.qr-card {
    background: white;
    border: 1px solid var(--border-grey);
    border-radius: 8px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 1;
}

.qr-card:hover,
.qr-card.dropdown-open {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

/* Card Columns */
.select-col {
    flex-shrink: 0;
}

.qr-checkbox {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    cursor: pointer;
}

.type-icon-col {
    flex-shrink: 0;
}

.type-icon-box {
    width: 36px;
    height: 36px;
    border: 1px solid #f1f5f9;
    background: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.info-col {
    flex: 1;
    min-width: 0;
}

.type-label {
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 1px;
    text-transform: uppercase;
}

.qr-url-link {
    font-size: 16px;
    font-weight: 500;
    color: #1e293b;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 5px;
}

.meta-grid-layout {
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px 40px;
}

.meta-stack {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.meta-item i {
    width: 12px;
    height: 12px;
    opacity: 0.8;
}

.stats-col {
    text-align: center;
    border-left: 1px solid #f1f5f9;
    padding-left: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

[dir="rtl"] .stats-col {
    border-left: none;
    border-right: 1px solid #f1f5f9;
    padding-left: 0;
    padding-right: 15px;
}

.stats-val-box {
    display: flex;
    flex-direction: column;
}

.stats-num {
    font-size: 20px;
    font-weight: 600;
    color: #334155;
}

.stats-label {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 600;
}

.details-link {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

.qr-preview-col {
    padding: 0 5px;
    width: 100px;
}

.th-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: #fff;
    border-radius: 6px;
    padding: 2px;
}

.th-container canvas,
.th-container svg {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.action-col {
    width: 160px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.btn-download-pro {
    width: 100%;
    padding: 12px;
    background: #f0fdf4;
    border: 1px solid #bcf09d;
    color: #166534;
    font-weight: 800;
    font-size: 13px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
    transform: translateY(22px);
}

.action-col:hover .btn-download-pro,
.action-col.dropdown-active .btn-download-pro {
    transform: translateY(0);
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 10px 20px rgba(130, 201, 30, 0.2);
}

.qr-action-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    transform: translateY(10px);
    margin-top: 5px;
}

.action-col:hover .qr-action-row,
.action-col.dropdown-active .qr-action-row {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.btn-icon-sm {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: 0.2s;
}

.btn-icon-sm:hover {
    color: var(--primary);
    background: #f0f9ff;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .qr-card {
        gap: 20px;
        padding: 20px;
    }

    .meta-row {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .qr-card {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 15px;
        text-align: left;
    }
    
    [dir="rtl"] .qr-card {
        text-align: right;
    }

    .select-col {
        position: absolute;
        top: 10px;
        right: 10px;
    }
    
    [dir="rtl"] .select-col {
        right: auto;
        left: 10px;
    }

    .type-icon-col {
        display: flex;
        justify-content: flex-start;
        margin-bottom: -5px;
    }

    .info-col {
        width: 100%;
    }

    .qr-url-link {
        font-size: 15px !important;
        margin-bottom: 8px;
    }

    .meta-grid-layout {
        grid-template-columns: 1fr 1fr;
        gap: 6px 10px;
        justify-content: start;
    }

    .stats-col {
        border-left: none;
        border-top: 1px solid #f1f5f9;
        border-bottom: 1px solid #f1f5f9;
        padding: 8px 15px;
        margin: 5px 0;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
    }

    .details-link {
        padding: 5px 12px;
        font-size: 12px;
    }

    .stats-num {
        font-size: 20px;
    }

    .qr-preview-col {
        width: 100%;
        display: flex;
        justify-content: center;
        padding: 5px 0;
    }

    .th-container {
        width: 100px;
        height: 100px;
        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;
    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;
}

/* Folder 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: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    width: 160px;
    display: none;
    flex-direction: column;
    padding: 6px;
}

.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: #64748b;
    font-weight: 500;
}

.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: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.top-nav-left {
    display: flex;
    align-items: center;
    gap: 25px;
}

.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 {
    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: 140px;
    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;
    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;
}

.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 {
    margin-top: auto;
    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: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    color: #fff;
    font-weight: 700;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    [dir="rtl"] .sidebar {
        transform: translateX(100%);
    }
    .sidebar.active {
        transform: translateX(0) !important;
    }
    .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; }
.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: 14px 35px; 
    border-radius: 14px; 
    font-weight: 800; 
    cursor: pointer; 
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(130, 201, 30, 0.2);
}
.btn-save:hover {
    background: #74b816;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(130, 201, 30, 0.3);
}

.text-input, input[type="text"], input[type="email"], input[type="password"], select {
    width: 100%;
    padding: 12px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    outline: none;
    transition: all 0.2s ease;
}

.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%; }
}

.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: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
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;
    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: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        width: 100% !important;
    }
    
    /* Make body overflow hidden when modal is active to prevent background scrolling */
    body:has(.modal.active) {
        overflow: hidden !important;
    }
}
