:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.18);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #1e293b;
    color: white;
    height: 100vh;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.logo-box {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-group {
    margin-bottom: 2rem;
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #e2e8f0;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: var(--primary);
}

/* Main Content */
.main-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.top-bar {
    height: 70px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
}
.top-bar .search-container {
    flex: 1;
}
.top-bar > div:last-child {
    margin-left: auto;
}

.content-area {
    padding: 2rem;
}

/* Components */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.table-container {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Dashboard Grids */
.dashboard-grid-1-1 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

/* CRM Switcher */
.crm-switcher {
    display: flex;
    gap: 1rem;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 8px;
}

.switch-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.switch-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.animate-fade {
    animation: fadeIn 0.4s ease forwards;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 600px;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Utils */
.text-right { text-align: right; }
.mt-2 { margin-top: 1rem; }
.gap-2 { gap: 0.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Landing Page */
.landing-hero {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    border-radius: 24px;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.vitrine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.vitrine-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: left;
}

.vitrine-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Contact */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

/* Autocomplete Dropdown */
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    max-height: 200px;
    overflow-y: auto;
    z-index: 200;
    margin-top: 2px;
}

.autocomplete-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f1f5f9;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #f0f9ff;
}

/* Language Switcher CRM */
.lang-switcher-crm {
    position: relative;
    margin-right: 0.5rem;
}

.lang-btn-crm {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 0.5rem 0.8rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #6366f1;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s ease;
}

.lang-btn-crm:hover {
    background: #6366f1;
    color: white;
}

.lang-dropdown-crm {
    position: absolute;
    top: 100%;
    right: 0;
    width: 150px;
    background: white;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    display: none;
    z-index: 1000;
}

.lang-dropdown-crm.active,
.lang-switcher-crm:hover .lang-dropdown-crm {
    display: block;
    animation: slideInNav 0.2s ease-out;
}

.lang-dropdown-crm a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.875rem;
    transition: background 0.2s;
}

.lang-dropdown-crm a:first-child {
    border-radius: 12px 12px 0 0;
}

.lang-dropdown-crm a:last-child {
    border-radius: 0 0 12px 12px;
}


/* CRM Switcher */
.crm-switcher {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #f1f5f9;
    padding: 0.3rem;
    border-radius: 12px;
    margin-right: 1rem;
}

.crm-switch-btn {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    color: #64748b;
    transition: all 0.2s;
}

.crm-switch-btn.active {
    background: white;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.crm-switch-btn:hover:not(.active) {
    color: #0f172a;
    background: rgba(255,255,255,0.5);
}


.lang-dropdown-crm a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.875rem;
    transition: background 0.2s;
}

.lang-dropdown-crm a:hover {
    background: #f1f5f9;
}

/* RTL Overrides */
[dir="rtl"] .sidebar {
    border-left: 1px solid rgba(255,255,255,0.1);
    border-right: none;
}

[dir="rtl"] .lang-switcher-crm {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .lang-dropdown-crm {
    right: auto;
    left: 0;
}

[dir="rtl"] .nav-item i {
    margin-right: 0;
    margin-left: 0.75rem;
}

[dir="rtl"] .stat-card i {
    right: auto;
    left: 1.5rem;
}

[dir="rtl"] .modal-content {
    text-align: right;
}

[dir="rtl"] .close-modal {
    right: auto;
    left: 1.5rem;
}

[dir="rtl"] .form-group label {
    text-align: right;
    display: block;
}

[dir="rtl"] .input-icon i {
    left: auto;
    right: 1rem;
}

[dir="rtl"] .input-icon input {
    padding-left: 1rem;
    padding-right: 2.5rem;
}

/* Utilities */
@media (max-width: 900px) {
    .hide-mobile {
        display: none !important;
    }
}

/* --- RTL Support --- */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] th {
    text-align: right;
}

[dir="rtl"] .logo i {
    margin-right: 0;
    margin-left: 0.8rem;
}

[dir="rtl"] .nav-links {
    margin-left: 0 !important;
    margin-right: auto !important;
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-links a i {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .dropbtn i {
    margin-left: 0;
    margin-right: 0.2rem;
}

[dir="rtl"] .nav-free-badge {
    margin-left: 0;
    margin-right: 1.5rem;
}

[dir="rtl"] .icon-box {
    margin-right: 0;
    margin-left: 1.5rem;
}

[dir="rtl"] .helps-list li {
    flex-direction: row-reverse;
}

[dir="rtl"] .footer-brand p {
    padding-right: 0;
}

[dir="rtl"] .card-btn i {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .faq-icon {
    margin-left: 0;
    margin-right: auto;
}




