/* Easy Store ERP Desktop Golden Edition Stylesheet - Pioneers Solutions Style */

:root {
    /* Fonts */
    --font-en: 'Outfit', sans-serif;
    --font-ar: 'Cairo', sans-serif;
    --font-active: var(--font-ar);
    /* Default Arabic */

    /* Classic Desktop Light/Steel Theme */
    --bg-desktop: #f4faf7;
    /* Soft mint green */
    --bg-window: #ffffff;
    --bg-widget: #f8f9fa;
    --bg-input: #ffffff;

    /* Pioneers Solutions Forest Green & Gold Identity */
    --forest-green-dark: #063f31;
    /* Primary Dark Teal */
    --forest-green-medium: #0c4a3b;
    --forest-green-light: #e6f2ee;
    --gold-accent: #f5c518;
    /* Gold Crown Accent */

    --border-color: #ced4da;
    --border-color-focus: #0c4a3b;

    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;

    /* Semantic Solid Colors */
    --primary: #0c4a3b;
    --primary-hover: #063f31;
    --success: #17b978;
    --success-hover: #118c5b;
    --warning: #ff8e53;
    --warning-hover: #e06d33;
    --danger: #ff4b5c;
    --danger-hover: #d83a48;
    --info: #08d9d6;

    /* Spacing & Borders */
    --transition-speed: 0.15s;
    --border-radius-sm: 2px;
    --border-radius-md: 4px;
    --border-radius-lg: 6px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* RTL layout overrides */
body.rtl-mode {
    --font-active: var(--font-ar);
    direction: rtl;
}

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

body {
    font-family: var(--font-active);
    background-color: var(--bg-desktop);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color var(--transition-speed);
}

/* WINDOW FRAME CONTAINER */
.window-container {
    width: 100%;
    height: 100%;
    background-color: var(--bg-window);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 1. TOP HEADER MENU BAR */
.header-menu-bar {
    height: 46px;
    background-color: var(--forest-green-dark);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    user-select: none;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.header-logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-cart-icon {
    font-size: 1.5rem;
    color: var(--gold-accent);
}

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.logo-sub {
    font-size: 0.65rem;
    color: #a3c4bc;
    margin-top: -2px;
}

.header-nav-menus {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0 20px;
    flex: 1;
}

.menu-item {
    position: relative;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: #e2edea;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-speed);
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.chevron-icon {
    font-size: 0.65rem;
    opacity: 0.7;
}

.menu-dropdown-content {
    position: absolute;
    top: 40px;
    left: 0;
    width: 230px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
    display: none;
    flex-direction: column;
    padding: 5px 0;
    z-index: 110;
    border-radius: var(--border-radius-md);
}

body.rtl-mode .menu-dropdown-content {
    left: auto;
    right: 0;
}

.menu-item:hover .menu-dropdown-content {
    display: flex;
}

.menu-dropdown-content a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.15s, color 0.15s;
}

.menu-dropdown-content a:hover {
    background-color: var(--forest-green-medium);
    color: #ffffff;
}

.menu-dropdown-content a i {
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.menu-dropdown-content a:hover i {
    color: #ffffff;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-action-btn {
    background-color: rgba(255, 255, 255, 0.12);
    border: none;
    color: #ffffff;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    transition: background-color var(--transition-speed);
}

.header-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.22);
}

/* 2. TOP TOOLBAR */
.toolbar-wrapper {
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 4px;
    z-index: 90;
    overflow-x: auto;
}

.toolbar-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 82px;
    height: 48px;
    min-width: max-content;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all var(--transition-speed);
}

.toolbar-btn i {
    font-size: 1.15rem;
}

.toolbar-btn:hover {
    background-color: var(--bg-desktop);
    border-color: #d1ebd8;
    color: var(--forest-green-dark);
}

.toolbar-btn.active {
    background-color: var(--forest-green-light);
    border-color: #a3c4bc;
    color: var(--forest-green-dark);
}

.toolbar-divider {
    width: 1px;
    height: 32px;
    background-color: #e2e8f0;
    margin: 0 6px;
}

/* Custom Text Colors for Toolbar Icons matching screenshots */
.text-green {
    color: #2ecc71;
}

.text-blue {
    color: #3498db;
}

.text-purple {
    color: #9b59b6;
}

.text-teal {
    color: #1abc9c;
}

.text-orange {
    color: #e67e22;
}

.text-dark-blue {
    color: #2980b9;
}

.text-grey {
    color: #7f8c8d;
}

.text-red {
    color: #e74c3c;
}

/* 3. WORKSPACE CONTAINER (Sidebar + Main panel) */
.workspace-wrapper {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* RIGHT NAVIGATION SIDEBAR */
.sidebar-navigation {
    width: 250px;
    background-color: var(--forest-green-dark);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 80;
    box-shadow: inset -5px 0 15px rgba(0, 0, 0, 0.1);
}

body.rtl-mode .sidebar-navigation {
    border-left: none;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.user-avatar-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--forest-green-dark);
    font-size: 1.25rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.user-info-text {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
}

.user-status-indicator {
    font-size: 0.65rem;
    color: #a3c4bc;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 1px;
}

.user-status-indicator .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #2ecc71;
    display: inline-block;
    box-shadow: 0 0 4px #2ecc71;
}

.sidebar-role-select {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--border-radius-sm);
    padding: 2px 6px;
    font-size: 0.7rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    margin-top: 3px;
    outline: none;
}

.sidebar-role-select option {
    background-color: var(--forest-green-dark);
    color: #ffffff;
}

.cashier-hidden {
    display: none !important;
}

.cashier-masked {
    filter: blur(4px);
    user-select: none;
    pointer-events: none;
}

/* Golden Edition Badge */
.golden-edition-badge {
    background-color: var(--gold-accent);
    color: var(--forest-green-dark);
    margin: 12px 16px;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.golden-crown {
    font-size: 0.85rem;
    color: #634d02;
}

/* Sidebar Navigation list */
.sidebar-nav-links {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    gap: 2px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-link {
    background: none;
    border: none;
    width: 100%;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #b8d2cc;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: right;
    transition: all var(--transition-speed);
}

.sidebar-link i {
    font-size: 1.05rem;
    width: 18px;
    text-align: center;
}

.sidebar-link .arrow-icon {
    margin-right: auto;
    font-size: 0.65rem;
    opacity: 0.5;
    transition: transform var(--transition-speed);
}

body.rtl-mode .sidebar-link .arrow-icon {
    margin-right: 0;
    margin-left: auto;
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.sidebar-link.active {
    background-color: var(--forest-green-medium);
    color: #ffffff;
    box-shadow: inset 4px 0 0 var(--gold-accent);
}

body.rtl-mode .sidebar-link.active {
    box-shadow: inset -4px 0 0 var(--gold-accent);
}

.sidebar-link.active .arrow-icon {
    transform: rotate(-90deg);
    opacity: 1;
    color: var(--gold-accent);
}

/* MAIN ACTIVE CONTENT VIEWPORTS */
.workspace-area {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background-color: var(--bg-desktop);
    position: relative;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.15s ease-out;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* DEFAULT SPLASH LOGO VIEW */
.dashboard-splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 10px 0;
}

.splash-logo-container {
    text-align: center;
    margin-bottom: 24px;
    width: 100%;
}

.splash-image {
    max-width: 85%;
    /* Allows full width */
    width: 100%;
    height: 400px;
    object-fit: fit;
    /* Prevents the logo from looking squished */
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    margin-bottom: 16px;
    border: 2px solid #ffffff;
}

.splash-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--forest-green-dark);
}

.splash-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
    letter-spacing: 0.5px;
}

/* KPI CARDS GRID */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 900px;
    margin-bottom: 24px;
}

.kpi-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.kpi-info {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.kpi-val {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--forest-green-dark);
    margin-top: 4px;
}

.kpi-icon {
    font-size: 1.8rem;
    opacity: 0.8;
}

.kpi-card.sales .kpi-icon {
    color: #2ecc71;
}

.kpi-card.profit .kpi-icon {
    color: #e67e22;
}

.kpi-card.stock .kpi-icon {
    color: #3498db;
}

/* Sales Chart Wrapper */
.splash-chart-container {
    width: 100%;
    max-width: 900px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.chart-wrapper {
    height: 180px;
    position: relative;
}

/* 4. BOTTOM FOOTER STATUS BAR */
.footer-status-bar {
    height: 32px;
    background-color: var(--forest-green-dark);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-size: 0.75rem;
    z-index: 100;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

.footer-clock-section {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--gold-accent);
}

.footer-links-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-link-btn {
    background: none;
    border: none;
    color: #cbd5e1;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color var(--transition-speed);
}

.footer-link-btn i {
    font-size: 0.8rem;
    color: var(--gold-accent);
}

.footer-link-btn:hover {
    color: #ffffff;
}

/* 8. WAREHOUSES DESKTOP WINDOW PAGE (Screenshot 2 demand) */
.warehouses-page-window {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.window-inner-header {
    background-color: #e9ecef;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--forest-green-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.warehouse-form-body-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 16px;
    gap: 20px;
    background-color: #ffffff;
}

.form-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.border-left-divider {
    border-left: none;
}

body.rtl-mode .border-left-divider {
    border-right: 1px solid #dee2e6;
    padding-right: 20px;
}

.column-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--forest-green-dark);
    border-bottom: 2px solid var(--forest-green-light);
    padding-bottom: 4px;
    margin-bottom: 8px;
}

/* Desktop-style compact form controls */
.form-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

.form-group-half {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-control-desktop {
    width: 100%;
    height: 28px;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius-sm);
    padding: 4px 8px;
    font-family: inherit;
    font-size: 0.78rem;
    background-color: #fcfdfc;
    transition: border-color var(--transition-speed);
}

.form-control-desktop-sm {
    width: 80px;
    height: 28px;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius-sm);
    padding: 4px 8px;
    font-family: inherit;
    font-size: 0.78rem;
    background-color: #f1f5f2;
}

.form-textarea-desktop {
    width: 100%;
    height: 48px;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius-sm);
    padding: 4px 8px;
    font-family: inherit;
    font-size: 0.78rem;
    background-color: #fcfdfc;
    resize: none;
}

.form-control-desktop:focus,
.form-textarea-desktop:focus {
    border-color: var(--forest-green-medium);
    outline: none;
    box-shadow: 0 0 0 2px rgba(12, 74, 59, 0.1);
}

/* Form Labels */
.form-column label {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Action button row matching Screenshot 2 */
.warehouse-action-row {
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
}

.btn-desktop-primary {
    background-color: var(--forest-green-medium);
    color: #ffffff;
    border: 1px solid #09372c;
    height: 30px;
    padding: 4px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-desktop-primary:hover {
    background-color: var(--forest-green-dark);
}

.btn-desktop-secondary {
    background-color: #ffffff;
    color: var(--text-primary);
    border: 1px solid #ced4da;
    height: 30px;
    padding: 4px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-desktop-secondary:hover {
    background-color: #f1f3f5;
}

.btn-desktop-danger {
    background-color: #fff0f1;
    color: var(--danger);
    border: 1px solid #ffa3a8;
    height: 30px;
    padding: 4px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-desktop-danger:hover {
    background-color: #ffe3e5;
}

/* Bottom table grid style matching Screenshot 2 */
.warehouse-table-container {
    padding: 16px;
    background-color: #ffffff;
}

.table-desktop {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.76rem;
}

.table-desktop th {
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    font-weight: 700;
    color: var(--forest-green-dark);
    text-align: right;
}

.table-desktop td {
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    color: var(--text-primary);
}

.table-desktop tbody tr:nth-child(even) {
    background-color: #fcfdfc;
}

.table-desktop tbody tr:hover {
    background-color: #f1f8f5;
}

/* ---------------- COMPONENT INTERFACE PANELS ---------------- */

.pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.pane-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--forest-green-dark);
}

.pane-header p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Standard Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    height: 32px;
    padding: 0 16px;
    border-radius: var(--border-radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

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

.btn-secondary {
    background-color: #ffffff;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: #f1f3f5;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    height: 40px;
    font-size: 0.88rem;
}

/* Forms */
.form-group {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 6px 12px;
    font-family: inherit;
    font-size: 0.8rem;
    background-color: var(--bg-input);
    transition: border-color var(--transition-speed);
}

.form-control:focus {
    border-color: var(--border-color-focus);
    outline: none;
}

/* Table layout lists */
.table-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 16px;
}

.search-input {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-input i {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

body.rtl-mode .search-input i {
    right: auto;
    left: 12px;
}

.search-input input {
    width: 100%;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 6px 12px 6px 36px;
    font-family: inherit;
    font-size: 0.8rem;
    background-color: #ffffff;
    transition: border-color var(--transition-speed);
}

body.rtl-mode .search-input input {
    padding: 6px 36px 6px 12px;
}

.search-input input:focus {
    border-color: var(--forest-green-medium);
    outline: none;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-actions select {
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 4px 10px;
    font-family: inherit;
    font-size: 0.8rem;
    background-color: #ffffff;
}

.table-responsive {
    max-height: 400px;
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
}

.table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid var(--border-color);
    padding: 10px 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: right;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table td {
    padding: 10px 12px;
    border-bottom: 1px solid #edf2f7;
    color: var(--text-primary);
}

.table tbody tr:hover {
    background-color: #f8fcf9;
}

.status-badge {
    padding: 2px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: var(--border-radius-sm);
    display: inline-block;
}

.status-badge.in-stock,
.status-badge.paid {
    background-color: #def7ec;
    color: #03543f;
}

.status-badge.low-stock,
.status-badge.pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.out-of-stock,
.status-badge.unpaid {
    background-color: #fde8e8;
    color: #9b1c1c;
}

.table-action-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-left: 4px;
    transition: all var(--transition-speed);
}

.table-action-btn:hover {
    background-color: var(--bg-desktop);
    color: var(--forest-green-dark);
}

/* ---------------- POINT OF SALE CASHIER Drawer ---------------- */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 16px;
    height: calc(100vh - 170px);
}

.pos-catalog {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

.catalog-filters {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.category-btn {
    background-color: var(--bg-widget);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-speed);
}

.category-btn.active,
.category-btn:hover {
    background-color: var(--forest-green-medium);
    color: #ffffff;
    border-color: var(--forest-green-medium);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    overflow-y: auto;
    flex: 1;
    align-content: start;
}

.product-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all var(--transition-speed);
}

.product-card:hover {
    border-color: var(--forest-green-medium);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.stock-tag {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.62rem;
}

body.rtl-mode .stock-tag {
    right: auto;
    left: 6px;
}

.product-icon-box {
    width: 48px;
    height: 48px;
    background-color: var(--forest-green-light);
    color: var(--forest-green-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: 50%;
    margin: 12px 0 8px;
}

.product-name {
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 32px;
    min-height: 42px;
    line-height: 1.4;
}

.product-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--forest-green-medium);
    margin-top: 6px;
}

/* POS CHECKOUT Cart */
.pos-cart {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.cart-header {
    background-color: var(--bg-widget);
    border-bottom: 1px solid var(--border-color);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-header h3 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--forest-green-dark);
}

.invoice-number {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: monospace;
    font-weight: bold;
}

.btn-clear-cart {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.95rem;
}

.cart-client-select {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-client-select i {
    color: var(--text-muted);
}

.cart-client-select select {
    flex: 1;
    height: 28px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-family: inherit;
    font-size: 0.78rem;
}

.btn-add-client {
    background-color: var(--forest-green-light);
    color: var(--forest-green-dark);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background-color: #fafdfb;
}

.empty-cart-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 10px;
}

.empty-cart-state i {
    font-size: 2.2rem;
    opacity: 0.6;
}

.empty-cart-state p {
    font-size: 0.78rem;
    text-align: center;
}

.cart-item {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 8px;
    display: flex;
    align-items: center;
    position: relative;
    animation: slideIn 0.12s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-right: 4px;
}

.cart-item-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.cart-item-price {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.cart-item-qty-actions {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    height: 24px;
    margin: 0 10px;
}

.qty-btn {
    background-color: var(--bg-widget);
    border: none;
    width: 22px;
    height: 100%;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.75rem;
}

.qty-val {
    padding: 0 8px;
    font-size: 0.75rem;
    font-weight: 700;
}

.cart-item-subtotal {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--forest-green-dark);
    min-width: 60px;
    text-align: left;
}

body.rtl-mode .cart-item-subtotal {
    text-align: right;
}

.btn-remove-item {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.95rem;
    margin-left: 6px;
}

.cart-summary {
    background-color: var(--bg-widget);
    border-top: 1px solid var(--border-color);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.summary-row.discount {
    align-items: center;
}

.discount-input-wrapper input {
    width: 45px;
    height: 22px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 2px 4px;
    font-family: inherit;
    font-size: 0.72rem;
    text-align: center;
}

.summary-row.total {
    border-top: 1px dashed var(--border-color);
    padding-top: 8px;
    margin-top: 4px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--forest-green-dark);
}

.cart-payment-methods {
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-payment-methods label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.payment-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.payment-grid input[type="radio"] {
    display: none;
}

.payment-grid label {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all var(--transition-speed);
}

.payment-grid input[type="radio"]:checked+label {
    background-color: var(--forest-green-medium);
    color: #ffffff;
    border-color: var(--forest-green-medium);
}

/* ---------------- DAILY LEDGER ACCOUNTING PANELS ---------------- */
.accounting-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 16px;
}

.ledger-stats {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.ledger-revenue {
    color: var(--success);
}

.ledger-expense {
    color: var(--danger);
}

.safe-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    background-color: #fdfdfd;
}

.safe-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.safe-info i {
    font-size: 1.4rem;
    color: var(--forest-green-medium);
}

.safe-info h4 {
    font-size: 0.8rem;
    font-weight: 700;
}

.safe-info p {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.safe-balance {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--forest-green-dark);
}

/* ---------------- HR STAFF MODULE ---------------- */
.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.staff-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 2px solid var(--forest-green-light);
}

.staff-card h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.staff-card .role {
    font-size: 0.72rem;
    color: var(--text-muted);
    background-color: var(--bg-desktop);
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: 4px;
    font-weight: 700;
}

.staff-card .salary {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--forest-green-dark);
    margin: 12px 0;
}

.staff-actions {
    width: 100%;
}

.attendance-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    width: 100%;
    padding: 6px 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-speed);
}

.attendance-toggle .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.attendance-toggle.present {
    border-color: #a7f3d0;
    background-color: #ecfdf5;
    color: #047857;
}

.attendance-toggle.present .dot {
    background-color: #10b981;
}

.attendance-toggle.absent {
    border-color: #fecaca;
    background-color: #fef2f2;
    color: #b91c1c;
}

.attendance-toggle.absent .dot {
    background-color: #ef4444;
}

/* ---------------- REPORTS & STATISTICS ---------------- */
.reports-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
}

.report-preview-card {
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.report-preview-card .card-body {
    flex: 1;
    overflow-y: auto;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 12px;
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.8rem;
    text-align: center;
    max-width: 300px;
}

.report-header-preview {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.report-header-preview h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--forest-green-dark);
}

.report-header-preview p {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ---------------- GENERAL ENTERPRISE GRID CARDS ---------------- */
.grid-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.card-header {
    background-color: var(--bg-widget);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 16px;
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 16px;
}

/* ---------------- SETTINGS PAGE ---------------- */
.settings-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.sec-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.permissions-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

.einvoice-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.toggle-switch .slider {
    width: 36px;
    height: 18px;
    background-color: #cbd5e1;
    border-radius: 20px;
    position: relative;
    transition: background-color var(--transition-speed);
}

.toggle-switch .slider::before {
    content: "";
    width: 14px;
    height: 14px;
    background-color: #ffffff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform var(--transition-speed);
}

.toggle-switch input:checked+.slider {
    background-color: var(--forest-green-medium);
}

.toggle-switch input:checked+.slider::before {
    transform: translateX(18px);
}

.eta-status-box {
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius-md);
    padding: 12px;
    background-color: #fafbfc;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: bold;
    color: #047857;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.meta-info {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ---------------- MODAL FORM DIALOGS ---------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 16px;
    backdrop-filter: blur(2px);
}

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

.modal {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 500px;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    animation: modalSlide 0.15s ease-out;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-lg-custom {
    max-width: 700px;
}

.modal-sm {
    max-width: 320px;
}

.modal-header {
    background-color: var(--bg-widget);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--forest-green-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-speed);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.form-section-title {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--forest-green-medium);
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 4px;
    margin: 12px 0 8px;
}

.form-section-title:first-of-type {
    margin-top: 0;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.form-row-triple {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 8px;
}

.input-action-group {
    display: flex;
    gap: 6px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

/* ---------------- CLASSIC RECEIPT PRINT FORMATTING ---------------- */
.receipt-print-area {
    font-family: monospace;
    font-size: 0.75rem;
    color: #000;
    padding: 4px;
}

.receipt-header {
    text-align: center;
}

.receipt-header h2 {
    font-size: 1rem;
    font-weight: 700;
}

.receipt-header p {
    font-size: 0.65rem;
    margin-top: 2px;
}

.receipt-divider {
    border-top: 1px dashed #000;
    margin: 8px 0;
}

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

.receipt-table th {
    border-bottom: 1px dashed #000;
    padding-bottom: 4px;
    font-weight: 700;
}

.receipt-table td {
    padding: 4px 0;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.receipt-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.receipt-summary-row {
    display: flex;
    justify-content: space-between;
}

.receipt-summary-row.total {
    font-weight: 700;
    font-size: 0.85rem;
}

.receipt-eta-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.eta-meta {
    font-size: 0.62rem;
    line-height: 1.3;
}

.mock-qr-code {
    width: 48px;
    height: 48px;
    background: repeating-linear-gradient(45deg, #000, #000 2px, #fff 2px, #fff 4px);
    border: 1px solid #000;
}

.receipt-footer {
    text-align: center;
    font-size: 0.65rem;
    margin-top: 8px;
}

/* ---------------- BARCODE LABEL STYLING ---------------- */
.barcode-print-preview-box {
    border: 1px solid #000;
    padding: 10px;
    text-align: center;
    background: #fff;
    font-family: monospace;
    font-size: 0.7rem;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.barcode-store {
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.barcode-name {
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.barcode-stripes-box {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    gap: 1px;
    background-color: #fff;
    margin-bottom: 4px;
}

.stripe-line {
    background-color: #000;
    height: 100%;
}

.stripe-thick {
    width: 3px;
}

.stripe-medium {
    width: 2px;
}

.stripe-thin {
    width: 1px;
}

.barcode-code {
    font-size: 0.65rem;
    letter-spacing: 2px;
}

.barcode-price {
    font-weight: 700;
    font-size: 0.75rem;
    margin-top: 4px;
}

/* ---------------- WEB PRINT OVERRIDES ---------------- */
@media print {
    body {
        background-color: #fff !important;
        padding: 0 !important;
    }

    .window-container {
        border: none !important;
        box-shadow: none !important;
        height: auto !important;
        overflow: visible !important;
    }

    .header-menu-bar,
    .toolbar-wrapper,
    .sidebar-navigation,
    .footer-status-bar,
    .modal-header,
    .modal-actions,
    .table-actions-bar,
    .pane-header {
        display: none !important;
    }

    .workspace-wrapper {
        display: block !important;
    }

    .workspace-area {
        padding: 0 !important;
        background-color: #fff !important;
    }

    .tab-pane {
        display: none !important;
    }

    /* Print target modals directly */
    #receiptModal.active,
    #barcodePrintModal.active {
        display: block !important;
        position: static !important;
        background: none !important;
        backdrop-filter: none !important;
        padding: 0 !important;
    }

    #receiptModal.active .modal,
    #barcodePrintModal.active .modal {
        border: none !important;
        box-shadow: none !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .receipt-print-area {
        width: 80mm;
        /* Standard 3-inch receipt paper */
        margin: 0 auto;
    }

    .barcode-print-preview-box {
        width: 50mm;
        /* Standard barcode labels width */
        height: 25mm;
        margin: 0 auto;
        border: none !important;
    }
}

@media (max-width: 1024px) {

    .pos-layout,
    .accounting-grid,
    .reports-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .pos-cart {
        margin-top: 16px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Devices (Max 768px) */
@media (max-width: 768px) {

    /* 1. Fixed Header & Hide Redundant Menus */
    .header-nav-menus {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }

    .header-menu-bar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 100;
        padding: 0 10px;
    }

    .logo-sub {
        display: none;
    }

    .logo-title {
        font-size: 1rem;
    }

    /* 2. Fixed Horizontal Toolbar */
    .toolbar-wrapper {
        position: fixed;
        top: 46px;
        left: 0;
        width: 100%;
        z-index: 90;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        padding: 4px 8px;
    }

    .toolbar-wrapper::-webkit-scrollbar {
        height: 4px;
        display: block;
    }

    .toolbar-wrapper::-webkit-scrollbar-track {
        background: transparent;
    }

    .toolbar-wrapper::-webkit-scrollbar-thumb {
        background: #a3c4bc;
        border-radius: 4px;
    }

    .toolbar-btn {
        min-width: max-content;
        /* Adjusts to text width */
        padding: 4px 12px;
        white-space: nowrap;
        /* Stops text from wrapping to a second line */
    }

    .toolbar-btn span {
        font-size: 0.7rem;
        margin-top: 4px;
    }

    /* Adjust Main Window for Fixed Tops */
    .window-container {
        display: block;
        overflow-y: auto;
        height: 100vh;
    }

    .workspace-wrapper {
        display: block;
        margin-top: 106px;
        /* 46px header + 60px toolbar */
    }

    .workspace-area {
        overflow-y: visible;
        padding: 10px;
    }

    /* 3. Slide-in Sidebar (Hidden by default, slides from Right in RTL) */
    .sidebar-navigation {
        position: fixed;
        top: 0;
        right: -280px;
        /* Hidden off-screen right */
        width: 260px;
        height: 100vh;
        z-index: 200;
        transition: right 0.3s ease-in-out;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
        padding-top: 46px;
        /* Space for close button if needed */
    }

    /* When active class is added via JavaScript */
    .sidebar-navigation.open {
        right: 0;
    }

    /* Keep user card and badge inside sidebar */
    .sidebar-user-card,
    .golden-edition-badge {
        display: flex;
    }

    /* 4. Vertical Stacked Footer */
    .footer-status-bar {
        position: relative;
        height: auto;
        flex-direction: column;
        padding: 24px 16px;
        gap: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .footer-links-wrapper {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 16px;
    }

    .footer-link-btn {
        font-size: 0.85rem;
    }

    /* Grids & Forms Stacking */
    .kpi-grid,
    .warehouse-form-body-wrapper,
    .settings-grid-layout,
    .staff-grid {
        grid-template-columns: 1fr;
    }

    .form-row,
    .form-row-triple {
        flex-direction: column;
        gap: 10px;
    }

    .form-group-half,
    .form-group {
        width: 100%;
    }

    .form-column.border-left-divider,
    body.rtl-mode .form-column.border-left-divider {
        border: none;
        padding: 0;
        margin-top: 16px;
        border-top: 2px solid var(--forest-green-light);
        padding-top: 16px;
    }

    .pane-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .pane-header .btn {
        width: 100%;
        justify-content: center;
    }

    .pos-grid-container {
        overflow-x: auto !important;
    }

    /* 2. Stop the text from squishing and wrapping to new lines */
    .pos-boq-table th,
    .pos-boq-table td {
        white-space: nowrap !important;
        min-width: 120px !important;
        /* Gives each column enough space */
    }

    /* 3. Make the # (ID) column small since it only holds a number */
    .pos-boq-table th:first-child,
    .pos-boq-table td:first-child {
        min-width: 40px !important;
    }

    /* 1. Un-restrict the dropdown width and allow it to expand */
    .pos-search-results {
        left: auto !important;
        /* Removes the strict width limit */
        right: 0 !important;
        /* Keeps it anchored to the right for Arabic RTL */
        min-width: 260px !important;
        /* Gives it a good default size on mobile */
        width: max-content !important;
        /* Allows it to grow to fit the text */
        max-width: 90vw !important;
        /* Prevents it from going off the phone screen */
    }

    /* 2. Allow long product names to wrap to a new line instead of forcing a scroll */
    .pos-search-item,
    .pos-search-item .item-title,
    .pos-search-item .item-sub {
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    /* Force payment radio buttons and text to stay on one horizontal line */
    .payment-radio-group label {
        display: flex !important;
        align-items: center !important;
        flex-direction: row !important;
        gap: 5px !important;
        white-space: nowrap !important;
    }

    /* Optional: allow the group itself to wrap if the screen is extremely small */
    .payment-radio-group {
        flex-wrap: wrap !important;
    }

    /* Force the POS summary/checkout bar items to stack or align cleanly */
    .pos-bottom-bar {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
    }

    /* Make sure the summary inline elements wrap correctly */
    .pos-summary-inline {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        gap: 12px !important;
    }

    /* Target the inventory table wrapper specifically */
    #tab-inventory .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Prevent cells from crushing Arabic text */
    #inventoryTable th,
    #inventoryTable td {
        white-space: nowrap !important;
        padding: 12px 14px !important;
        text-align: right !important;
    }

    /* Fix action bar controls so they don't wrap awkwardly on mobile */
    #tab-inventory .table-actions-bar {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    #tab-inventory .search-input {
        flex: 1 1 200px !important;
    }

    #tab-inventory .filter-actions {
        display: flex !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
    }

    /* Ensure the purchases history table container enables horizontal scrolling */
    #tab-purchases .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Prevent text breaking and keep table rows compact on mobile */
    #purchaseInvoicesTable th,
    #purchaseInvoicesTable td {
        white-space: nowrap !important;
        padding: 12px 14px !important;
        text-align: right !important;
    }

    /* Fix invoice number column alignment for LTR text strings like PUR-# */
    #purchaseInvoicesTable th:first-child,
    #purchaseInvoicesTable td:first-child {
        direction: ltr !important;
        text-align: right !important;
    }

    body #tab-accounting.active {
        height: auto !important;
        display: block !important;
        overflow: visible !important;
    }

    body #tab-accounting .accounting-grid {
        display: flex !important;
        flex-direction: column !important;
    }

    /* Stop the card from growing to 988px and bleeding behind the footer */
    body #tab-accounting .ledger-card,
    body #tab-accounting .ledger-card .card-body {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 450px !important;
        overflow: hidden !important;
    }

    /* Confine both horizontal and vertical scrolling to the table wrapper */
    body #tab-accounting .ledger-card .table-responsive {
        display: block !important;
        width: 100% !important;
        max-height: 400px !important;
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Force the table to be wider than the phone screen */
    body #transactionsTable {
        width: max-content !important;
        min-width: 600px !important;
    }

    /* Keep the Arabic text rigidly on one line */
    body #transactionsTable th,
    body #transactionsTable td {
        white-space: nowrap !important;
        word-break: keep-all !important;
    }

    .crm-split-layout {
        flex-direction: column !important;
    }

    .crm-list-column {
        max-width: 100% !important;
        min-width: 100% !important;
        flex: none !important;
    }

    .crm-details-column {
        flex: none !important;
        width: 100% !important;
    }

    /* Fix Invoices Table on Mobile */
    #tab-invoices .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    #invoicesManagerTable th,
    #invoicesManagerTable td {
        white-space: nowrap !important;
        padding: 12px 14px !important;
    }
}

/* Hide Hamburger Button on Desktop Screens */
@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}

/* Small Mobile Phones (Max 480px) */
@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .payment-grid {
        grid-template-columns: 1fr;
    }

    .splash-title {
        font-size: 1.6rem;
    }

    .warehouse-action-row {
        flex-wrap: wrap;
    }

    .warehouse-action-row .btn {
        flex: 1;
        min-width: 45%;
        justify-content: center;
    }
}

/* ---------------- MESCO POS GRID TABLE STYLES ---------------- */
.pos-mesco-wrapper {
    background: var(--bg-window);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    padding: 18px;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pos-top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--forest-green-light);
    padding: 12px 18px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(12, 74, 59, 0.15);
    flex-wrap: wrap;
    gap: 12px;
}

.pos-info-block h2 {
    font-size: 1.2rem;
    color: var(--forest-green-dark);
    margin-bottom: 2px;
}

.invoice-number {
    font-family: var(--font-en);
    font-weight: 700;
    color: var(--warning);
    font-size: 0.95rem;
}

.pos-client-block,
.pos-payment-block {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.payment-radio-group {
    display: flex;
    gap: 12px;
    background: white;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.pos-grid-container {
    min-height: 330px;
    max-height: calc(100vh - 400px);
    overflow-y: auto;
}

.pos-boq-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 40px;
}

.pos-boq-table th {
    background-color: var(--forest-green-dark) !important;
    color: #ffffff !important;
    text-align: center;
    font-size: 0.88rem;
    padding: 10px;
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    box-shadow: inset 0 -1px 0 #dee2e6;
}

.pos-boq-table td {
    vertical-align: middle;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    position: relative !important;
    z-index: 1 !important;
}

.pos-search-wrapper {
    position: relative;
    width: 100%;
    z-index: 50;
}

.pos-search-wrapper:focus-within {
    z-index: 999;
}

.pos-search-results {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 99999 !important;
    background: #ffffff;
    border: 2px solid var(--forest-green-medium);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
    border-radius: var(--border-radius-md);
    max-height: 240px;
    overflow-y: auto;
    display: none;
}

.pos-search-item {
    padding: 9px 12px;
    border-bottom: 1px solid #f1f3f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.15s;
}

.pos-search-item:hover {
    background: var(--forest-green-light);
}

.pos-search-item .item-title {
    font-weight: 700;
    color: var(--forest-green-dark);
    font-size: 0.88rem;
}

.pos-search-item .item-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pos-search-item .item-price {
    font-weight: 700;
    color: var(--danger);
    font-size: 0.9rem;
}

.btn-del-row {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.15s;
}

.btn-del-row:hover {
    color: var(--danger-hover);
}

.pos-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 2px dashed var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

.pos-summary-inline {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.95rem;
}

.sum-item strong {
    color: var(--forest-green-dark);
}

.total-highlight {
    background: var(--forest-green-light);
    padding: 6px 12px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--forest-green-medium);
    font-size: 1.05rem;
}

.total-highlight strong {
    color: var(--danger);
    font-size: 1.15rem;
}

/* Sidebar hidden system-wide override */
.sidebar-navigation.sidebar-hidden,
.module-hidden {
    display: none !important;
}

/* ---------------- ACCOUNTING TAB SCROLL FIX V2 ---------------- */

/* 1. Account for header (46px) + toolbar (60px) + footer (32px) + padding (32px) = 170px */
#tab-accounting.active {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100vh - 180px) !important;
    /* 180px gives a safe margin */
    overflow: hidden !important;
}

/* 2. Force the grid to shrink if necessary */
#tab-accounting .accounting-grid {
    flex: 1 !important;
    min-height: 0 !important;
    /* CRITICAL for Flexbox scrolling */
    overflow: hidden !important;
}

/* 3. Force the ledger card to shrink */
#tab-accounting .ledger-card {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    /* CRITICAL */
    overflow: hidden !important;
}

/* 4. Pass the scrolling permission down */
#tab-accounting .ledger-card .card-body {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    /* CRITICAL: Stops table from stretching the card */
    overflow: hidden !important;
    padding-bottom: 0 !important;
}

/* 5. Apply the scrollbar only to the table container */
#tab-accounting .table-responsive {
    flex: 1 !important;
    max-height: none !important;
    height: 100% !important;
    overflow-y: auto !important;
    min-height: 0 !important;
}

/* 6. Guarantee the sticky header stays on top */
#transactionsTable thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    background-color: #f8f9fa !important;
    box-shadow: inset 0 -2px 0 var(--border-color) !important;
}

/* 1. Keep normal table behavior so it stays full width */
#reportPreviewArea .table {
    display: table !important;
    width: 100% !important;
}

/* 2. Apply the scrollbar ONLY to the table body */
#reportPreviewArea .table tbody {
    display: block !important;
    /* Increased from 350px to 420px to remove the outer page scroll */
    max-height: calc(100vh - 480px) !important;
    overflow-y: auto !important;
    width: 100% !important;
}

/* 3. Force the headers and rows to align perfectly and fill the space */
#reportPreviewArea .table thead,
#reportPreviewArea .table tbody tr {
    display: table !important;
    width: 100% !important;
    table-layout: fixed !important;
    /* Fixes the compacted columns */
}