:root {
    --malaz-teal: #0d6e6e;
    --malaz-teal-dark: #094f4f;
    --malaz-teal-light: #128585;
    --malaz-gold: #c9a227;
    --malaz-gold-light: #e0bc4a;
    --malaz-sidebar-width: 260px;
    --malaz-sidebar-collapsed: 72px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6;
    min-height: 100vh;
}

[dir="rtl"] body {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
}

/* Brand */
.malaz-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
}

.malaz-brand i {
    color: var(--malaz-gold);
    font-size: 1.5rem;
}

/* App layout */
.malaz-app-wrapper {
    display: flex;
    min-height: 100vh;
}

.malaz-sidebar {
    width: var(--malaz-sidebar-width);
    background: linear-gradient(180deg, var(--malaz-teal-dark) 0%, var(--malaz-teal) 100%);
    color: #fff;
    transition: width 0.25s ease;
    flex-shrink: 0;
    z-index: 1030;
}

.malaz-sidebar.collapsed {
    width: var(--malaz-sidebar-collapsed);
}

.malaz-sidebar.collapsed .brand-text,
.malaz-sidebar.collapsed .sidebar-menu .nav-link span,
.malaz-sidebar.collapsed .sidebar-footer {
    display: none;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu .nav-link {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

[dir="rtl"] .sidebar-menu .nav-link {
    border-left: none;
    border-right: 3px solid transparent;
}

.sidebar-menu .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-menu .nav-link.active {
    color: #fff;
    background: rgba(201, 162, 39, 0.15);
    border-left-color: var(--malaz-gold);
}

[dir="rtl"] .sidebar-menu .nav-link.active {
    border-left-color: transparent;
    border-right-color: var(--malaz-gold);
}

.sidebar-menu .nav-link i {
    font-size: 1.15rem;
    width: 1.5rem;
    text-align: center;
}

.malaz-sidebar-offcanvas {
    background: linear-gradient(180deg, var(--malaz-teal-dark) 0%, var(--malaz-teal) 100%);
    color: #fff;
    width: var(--malaz-sidebar-width);
}

.malaz-sidebar-offcanvas .sidebar-menu .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

.malaz-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.malaz-navbar {
    background: linear-gradient(90deg, var(--malaz-teal-dark), var(--malaz-teal));
    box-shadow: 0 2px 8px rgba(13, 110, 110, 0.25);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--malaz-gold);
    color: var(--malaz-teal-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Content */
.malaz-content {
    flex: 1;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--malaz-teal-dark);
    margin-bottom: 0.25rem;
}

.page-header .breadcrumb {
    margin-bottom: 0;
    font-size: 0.875rem;
}

/* Cards & KPI */
.kpi-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 110, 0.12);
}

.kpi-card .kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.kpi-card .kpi-icon.teal {
    background: rgba(13, 110, 110, 0.12);
    color: var(--malaz-teal);
}

.kpi-card .kpi-icon.gold {
    background: rgba(201, 162, 39, 0.15);
    color: var(--malaz-gold);
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--malaz-teal-dark);
}

/* Buttons */
.btn-malaz-primary {
    background-color: var(--malaz-teal);
    border-color: var(--malaz-teal);
    color: #fff;
}

.btn-malaz-primary:hover,
.btn-malaz-primary:focus {
    background-color: var(--malaz-teal-dark);
    border-color: var(--malaz-teal-dark);
    color: #fff;
}

.btn-malaz-gold {
    background-color: var(--malaz-gold);
    border-color: var(--malaz-gold);
    color: var(--malaz-teal-dark);
    font-weight: 600;
}

.btn-malaz-gold:hover {
    background-color: var(--malaz-gold-light);
    border-color: var(--malaz-gold-light);
    color: var(--malaz-teal-dark);
}

/* Tables */
.malaz-table thead {
    background-color: rgba(13, 110, 110, 0.08);
}

.malaz-table thead th {
    color: var(--malaz-teal-dark);
    font-weight: 600;
    border-bottom: 2px solid var(--malaz-teal);
    white-space: nowrap;
}

/* Status badges - pipeline */
.badge-status-new { background-color: #0dcaf0; color: #000; }
.badge-status-contacted { background-color: #6f42c1; }
.badge-status-qualified { background-color: #0d6efd; }
.badge-status-proposal { background-color: #fd7e14; }
.badge-status-negotiation { background-color: #ffc107; color: #000; }
.badge-status-won { background-color: #198754; }
.badge-status-lost { background-color: #dc3545; }

/* Unit status colors */
.unit-available { border-left: 4px solid #198754; }
.unit-reserved { border-left: 4px solid #ffc107; }
.unit-sold { border-left: 4px solid #dc3545; }
.unit-hold { border-left: 4px solid #6c757d; }

[dir="rtl"] .unit-available,
[dir="rtl"] .unit-reserved,
[dir="rtl"] .unit-sold,
[dir="rtl"] .unit-hold {
    border-left: none;
    border-right-width: 4px;
    border-right-style: solid;
}

[dir="rtl"] .unit-available { border-right-color: #198754; }
[dir="rtl"] .unit-reserved { border-right-color: #ffc107; }
[dir="rtl"] .unit-sold { border-right-color: #dc3545; }
[dir="rtl"] .unit-hold { border-right-color: #6c757d; }

.unit-card {
    border-radius: 0.5rem;
    transition: box-shadow 0.2s ease;
}

.unit-card:hover {
    box-shadow: 0 4px 16px rgba(13, 110, 110, 0.15);
}

/* Auth layout */
.auth-layout {
    background: linear-gradient(135deg, var(--malaz-teal-dark) 0%, var(--malaz-teal) 50%, #0a5555 100%);
    min-height: 100vh;
}

.auth-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.auth-logo {
    color: var(--malaz-teal);
    font-size: 2rem;
    font-weight: 700;
}

.auth-logo i {
    color: var(--malaz-gold);
}

/* Cards general */
.malaz-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.malaz-card .card-header {
    background: #fff;
    border-bottom: 1px solid rgba(13, 110, 110, 0.1);
    font-weight: 600;
    color: var(--malaz-teal-dark);
}

/* RTL overrides */
[dir="rtl"] .me-1, [dir="rtl"] .me-2, [dir="rtl"] .me-3 {
    margin-right: 0 !important;
}

[dir="rtl"] .ms-1 { margin-left: 0 !important; margin-right: 0.25rem !important; }
[dir="rtl"] .ms-2 { margin-left: 0 !important; margin-right: 0.5rem !important; }
[dir="rtl"] .ms-3 { margin-left: 0 !important; margin-right: 1rem !important; }
[dir="rtl"] .ms-auto { margin-left: 0 !important; margin-right: auto !important; }

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

[dir="rtl"] .input-group > :not(:first-child) {
    border-radius: 0.375rem 0 0 0.375rem;
}

[dir="rtl"] .input-group > :not(:last-child) {
    border-radius: 0 0.375rem 0.375rem 0;
}

[dir="rtl"] .text-end {
    text-align: left !important;
}

[dir="rtl"] .text-start {
    text-align: right !important;
}

[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    float: right;
    padding-left: 0.5rem;
    padding-right: 0;
}

/* Loading spinner */
.malaz-spinner {
    color: var(--malaz-teal);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    color: var(--malaz-teal);
    opacity: 0.4;
}

/* =====================================================
   Odoo-style CRM Kanban (Leads Pipeline)
   ===================================================== */
.odoo-crm-page {
    margin: -1rem -0.75rem 0;
}

.odoo-control-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0;
}

.odoo-cp-left {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    min-width: 180px;
}

.odoo-cp-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.odoo-cp-subtitle {
    font-size: 0.875rem;
    color: #6c757d;
}

.odoo-cp-center {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: 200px;
}

.odoo-search-box {
    position: relative;
    flex: 1;
    min-width: 180px;
    max-width: 320px;
}

.odoo-search-box i {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 0.85rem;
}

[dir="rtl"] .odoo-search-box i {
    left: auto;
    right: 0.65rem;
}

.odoo-search-box input {
    padding-left: 2rem;
    border-radius: 0.25rem;
    border-color: #ced4da;
}

[dir="rtl"] .odoo-search-box input {
    padding-left: 0.75rem;
    padding-right: 2rem;
}

.odoo-filter-select {
    max-width: 160px;
    border-radius: 0.25rem;
}

.odoo-cp-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

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

.btn-odoo {
    background: #fff;
    border: 1px solid #ced4da;
    color: #495057;
}

.btn-odoo:hover {
    background: #f8f9fa;
    color: #212529;
}

.btn-odoo-active {
    background: #e9ecef;
    border: 1px solid #adb5bd;
    color: #212529;
}

.btn-odoo-create {
    background: #714B67;
    border-color: #714B67;
    color: #fff;
    font-weight: 600;
}

.btn-odoo-create:hover {
    background: #5c3d54;
    border-color: #5c3d54;
    color: #fff;
}

.odoo-view-switcher .btn {
    padding: 0.35rem 0.65rem;
}

.odoo-kanban-wrapper {
    background: #f0f0f0;
    min-height: calc(100vh - 180px);
    overflow-x: auto;
    padding: 0.75rem;
}

.odoo-kanban-board {
    display: flex;
    gap: 0.65rem;
    min-height: 480px;
    align-items: flex-start;
}

.odoo-kanban-column {
    flex: 0 0 280px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}

.odoo-kanban-column-header {
    background: #fff;
    border-radius: 0.35rem 0.35rem 0 0;
    border-top: 3px solid #875A7B;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.35rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.odoo-column-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.odoo-column-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #212529;
}

.odoo-column-count {
    background: rgba(0, 0, 0, 0.08);
    color: #495057;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 1rem;
}

.odoo-column-total {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.odoo-kanban-column-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.15rem;
    border-radius: 0 0 0.35rem 0.35rem;
    min-height: 120px;
    transition: background 0.15s ease;
}

.odoo-kanban-column-body.odoo-column-drag-over {
    background: rgba(113, 75, 103, 0.08);
    outline: 2px dashed #714B67;
    outline-offset: -2px;
    border-radius: 0.35rem;
}

.odoo-kanban-card {
    background: #fff;
    border-radius: 0.35rem;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    cursor: grab;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    border: 1px solid transparent;
}

.odoo-kanban-card:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.odoo-kanban-card.odoo-card-dragging {
    opacity: 0.55;
    cursor: grabbing;
    transform: rotate(2deg);
}

.odoo-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.odoo-card-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #212529;
    text-decoration: none;
    line-height: 1.3;
}

.odoo-card-title:hover {
    color: #714B67;
}

.odoo-card-stars {
    color: #E6AC00;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.odoo-card-meta {
    font-size: 0.75rem;
    color: #6c757d;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.4rem;
}

.odoo-card-meta i {
    margin-right: 0.25rem;
    opacity: 0.7;
}

[dir="rtl"] .odoo-card-meta i {
    margin-right: 0;
    margin-left: 0.25rem;
}

.odoo-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.45rem;
}

.odoo-tag {
    font-size: 0.68rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.2rem;
    background: #e9ecef;
    color: #495057;
    text-transform: capitalize;
}

.odoo-tag-hot { background: #fde8e8; color: #c0392b; }
.odoo-tag-warm { background: #fff3cd; color: #856404; }
.odoo-tag-cold { background: #e2e3e5; color: #495057; }
.odoo-tag-muted { background: #f8f9fa; color: #6c757d; }

.odoo-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.35rem;
    border-top: 1px solid #f0f0f0;
}

.odoo-card-budget {
    font-size: 0.75rem;
    font-weight: 600;
    color: #714B67;
}

.odoo-card-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #714B67;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.odoo-kanban-empty {
    text-align: center;
    padding: 1.5rem 0.5rem;
    color: #adb5bd;
    font-size: 0.8rem;
    font-style: italic;
}

.odoo-quick-add {
    display: block;
    text-align: center;
    padding: 0.4rem;
    color: #714B67;
    font-size: 0.8rem;
    text-decoration: none;
    border-radius: 0.25rem;
    opacity: 0.7;
}

.odoo-quick-add:hover {
    background: rgba(113, 75, 103, 0.08);
    opacity: 1;
    color: #714B67;
}

.odoo-list-card {
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0 1rem;
}

.odoo-list-table thead {
    background: #f8f9fa;
}

.odoo-list-table thead th {
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.odoo-stage-badge,
.badge-stage-new { background-color: #875A7B !important; color: #fff; }
.badge-stage-contacted { background-color: #00A09D !important; color: #fff; }
.badge-stage-qualified { background-color: #0074D9 !important; color: #fff; }
.badge-stage-site_visit { background-color: #FF851B !important; color: #fff; }
.badge-stage-negotiation { background-color: #E6AC00 !important; color: #212529; }
.badge-stage-booking { background-color: #2ECC40 !important; color: #212529; }
.badge-stage-won { background-color: #3D9970 !important; color: #fff; }
.badge-stage-lost { background-color: #999999 !important; color: #fff; }

.odoo-spinner {
    color: #714B67;
}

.odoo-quick-modal .odoo-modal-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.odoo-field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
}

.odoo-notes-box {
    background: #f8f9fa;
    border-radius: 0.35rem;
    padding: 0.75rem;
    font-size: 0.9rem;
    color: #495057;
}
