/* 
 * ERP Cinema Design v11.0 
 * Colors optimized for High Visibility
 */
:root {
    --erp-primary: #875A7B;
    /* Odoo Purple */
    --erp-bg: #f8fafc;
    --erp-card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --erp-paid: #22c55e;
    --erp-due: #ef4444;
    --erp-partial: #f59e0b;
}

/* Base Body State */
body.erp-mode-active #scrollable-container {
    background-color: var(--erp-bg) !important;
}

/* Toolbars and Buttons */
.erp-export-toolbar {
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
}

.dt-buttons {
    display: flex !important;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.dt-button {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
    box-shadow: none !important;
    background-image: none !important;
}

.dt-button:hover {
    background: #f1f5f9 !important;
    color: var(--erp-primary) !important;
    border-color: var(--erp-primary) !important;
}

#erp-view-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.erp-add-btn {
    background: #00A09D !important;
    /* Odoo Teal */
    color: white !important;
    padding: 6px 16px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    transition: all 0.2s !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.erp-add-btn:hover {
    background: #008986 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.erp-view-group {
    display: inline-flex;
    background: #f1f5f9;
    padding: 2px;
    border-radius: 8px;
    gap: 2px;
}

.erp-view-btn {
    background: transparent;
    border: none !important;
    color: #64748b !important;
    padding: 6px 12px !important;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

.erp-view-btn:hover {
    background: #f1f5f9;
    color: var(--erp-primary) !important;
}

.erp-view-btn.active {
    background: var(--erp-primary) !important;
    color: white !important;
}

/* Grid Layout */
.erp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

/* Card Design */
.erp-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--erp-card-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #f1f5f9;
    transition: transform 0.2s;
}

.erp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.erp-card-header {
    padding: 1.25rem 1rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    min-height: 60px;
}

.status-paid {
    background: linear-gradient(135deg, #10b981, #059669);
}

.status-due {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
}

.status-partial {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.status-other {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.erp-card-title {
    font-size: 1.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.erp-card-status {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.erp-card-body {
    padding: 1.25rem;
    flex: 1;
}

.erp-card-date {
    color: #64748b;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.erp-card-meta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.meta-item {
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 4px;
    border-bottom: 1px solid #f1f5f9;
}

.meta-label {
    color: #94a3b8;
    font-weight: 600;
}

.meta-value {
    font-weight: 700;
    color: #334155;
    background: #f8fafc;
    padding: 2px 8px;
    border-radius: 4px;
    max-width: 60%;
    text-align: right;
}

[dir="rtl"] .meta-value {
    text-align: left;
}

.erp-card-footer {
    padding: 1.25rem;
    border-top: 1px solid #f1f5f9;
    background: #fcfdfe;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.erp-card-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

.price-label {
    color: #64748b;
    font-size: 0.9rem;
}

.price-value {
    font-size: 1.15rem;
    color: #0f172a;
}

.erp-card-actions-row {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    border-top: 1px dashed #e2e8f0;
    padding-top: 0.5rem;
    position: relative;
}

.erp-card-actions-row .btn {
    border-radius: 8px;
    padding: 6px 16px !important;
    font-weight: 600;
}

.erp-card-actions-row .dropdown-menu {
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    top: auto !important;
    bottom: 100% !important;
    /* Open upwards if needed, or stick to auto */
    z-index: 1000;
}

/* Triple-Tier Layout Hierarchy */
.erp-mode-active .content {
    display: flex !important;
    flex-direction: column !important;
}

#erp-control-panel {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    border-radius: 8px;
}

.erp-order-control {
    order: 0 !important;
    display: flex !important;
}

.erp-order-filters {
    order: 1 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    margin-top: 5px !important;
    background: #fdfdfd !important;
    border: 1px solid #f1f5f9 !important;
    padding: 10px !important;
    border-radius: 8px !important;
}

.erp-order-filters .box,
.erp-order-filters .card {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
}

.erp-order-toolbar {
    order: 2 !important;
    display: flex !important;
    min-height: 50px;
    justify-content: center;
    align-items: center;
    background: #f8fafc;
    border-radius: 8px;
    margin: 10px 0 !important;
}

/* Ensure Odoo Header is Always Visible */
.odoo-control-panel {
    z-index: 1000 !important;
    position: sticky !important;
    top: 41px !important;
}

/* Professional Kanban Board Styles (Scale Optimized) */
.erp-kanban-board {
    display: flex !important;
    gap: 1rem;
    overflow-x: auto !important;
    padding: 1rem 0;
    align-items: flex-start;
    min-height: 80vh;
    background: transparent;
    direction: rtl;
    /* Explicit RTL for Arabic */
}

.kanban-column {
    min-width: 290px;
    /* Reduced width to fit more */
    width: 290px;
    flex-shrink: 0;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 8px;
    border-left: 5px solid #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.kanban-header.status-paid {
    border-left-color: #10b981;
}

.kanban-header.status-due {
    border-left-color: #ef4444;
}

.kanban-header.status-partial {
    border-left-color: #f59e0b;
}

.kanban-title {
    font-weight: 800;
    color: #1e293b;
    font-size: 0.9rem;
}

.kanban-count {
    background: #1e293b;
    color: #fff;
    padding: 1px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
}

.kanban-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.kanban-items .erp-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    font-size: 0.85rem;
}

/* Parent Fixes to avoid clipping */
.erp-mode-active .content {
    overflow-x: visible !important;
}

/* Scrollbar Style */
.erp-kanban-board::-webkit-scrollbar {
    height: 12px;
}

.erp-kanban-board::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 6px;
}

.erp-kanban-board::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
    border: 3px solid #e2e8f0;
}

.erp-hide-force {
    display: none !important;
}

/* --- MODERN REPORT STYLING --- */
.table-striped>tbody>tr:nth-of-type(odd) {
    background-color: transparent !important;
}

.table.table-striped {
    border-collapse: separate;
    border-spacing: 0 8px;
    background: transparent !important;
}

.table.table-striped tr {
    background: white !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    transition: transform 0.2s;
}

.table.table-striped tr:hover {
    transform: translateX(-4px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.table.table-striped th {
    padding: 15px !important;
    border: none !important;
    font-weight: 700;
    color: #475569;
    font-size: 0.95rem;
    vertical-align: middle !important;
}

.table.table-striped td {
    padding: 15px !important;
    border: none !important;
    text-align: left;
    vertical-align: middle !important;
}

[dir="rtl"] .table.table-striped td {
    text-align: right;
    /* Keep values on left globally */
}

.display_currency {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 800;
    color: #1e293b;
    font-size: 1.1rem;
    /* background: #f1f5f9; */
    padding: 4px 12px;
    border-radius: 6px;
    display: inline-block;
}

.text-muted {
    font-size: 0.75rem;
    color: #94a3b8 !important;
    font-weight: 500;
}

/* Custom Widgets for Reports */
.box-primary {
    border-top: 3px solid #6366f1 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05) !important;
}

.nav-tabs-custom {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important;
    overflow: hidden;
}

.nav-tabs-custom>.nav-tabs {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.nav-tabs-custom>.nav-tabs>li>a {
    font-weight: 600;
    color: #64748b;
    padding: 12px 20px;
    transition: all 0.2s;
}

.nav-tabs-custom>.nav-tabs>li.active>a {
    color: #6366f1 !important;
    border-top: none !important;
    background: white !important;
    box-shadow: inset 0 -3px 0 #6366f1;
}

/* Odoo-style Sidebar States - Robust Hiding */
body.sidebar-hidden .side-bar {
    display: none !important;
}

body.sidebar-hidden main {
    width: 100vw !important;
    max-width: 100vw !important;
}

/* Optional: Smooth transition if using width instead of display */
.side-bar {
    transition: transform 0.3s ease, width 0.3s ease !important;
}