/* ═══════════════════════════════════════════════════════════════════════
   ALMUDIR — Module pages polish (Sales · Products · Purchases · Contacts)
   Does NOT target POS (.alm-pro-page--pos)
   ═══════════════════════════════════════════════════════════════════════ */

.alm-pro-page--sales,
.alm-pro-page--products,
.alm-pro-page--purchases,
.alm-pro-page--purchase,
.alm-pro-page--contacts,
.alm-pro-page--reports,
.alm-pro-page--system.alm-pro-page--sells,
.alm-pro-page--system.alm-pro-page--products,
.alm-pro-page--system.alm-pro-page--purchases,
.alm-pro-page--system.alm-pro-page--contacts {
    --mod-accent: var(--tm-brand, #2563eb);
    --mod-accent-soft: var(--tm-brand-subtle, #eff6ff);
    background: linear-gradient(180deg, #eef2f7 0%, var(--alm-bg, #f4f7fb) 120px);
    padding-bottom: 24px;
}

.alm-pro-page--sales   { --mod-accent: #2563eb; --mod-accent-soft: #eff6ff; }
.alm-pro-page--products { --mod-accent: #7c3aed; --mod-accent-soft: #f5f3ff; }
.alm-pro-page--purchases,
.alm-pro-page--purchase { --mod-accent: #0d9488; --mod-accent-soft: #f0fdfa; }
.alm-pro-page--contacts { --mod-accent: #0891b2; --mod-accent-soft: #ecfeff; }

/* Hero accent per module */
.alm-pro-page--sales .alm-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
}
.alm-pro-page--products .alm-hero {
    background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 100%);
}
.alm-pro-page--purchases .alm-hero,
.alm-pro-page--purchase .alm-hero {
    background: linear-gradient(135deg, #115e59 0%, #0d9488 100%);
}
.alm-pro-page--contacts .alm-hero {
    background: linear-gradient(135deg, #155e75 0%, #0891b2 100%);
}

/* Filter panel */
.alm-pro-page--sales .box.box-solid,
.alm-pro-page--products .box.box-solid,
.alm-pro-page--purchases .box.box-solid,
.alm-pro-page--purchase .box.box-solid,
.alm-pro-page--contacts .box.box-solid {
    border-radius: 14px !important;
    border: 1px solid var(--alm-border, #e2e8f0) !important;
    box-shadow: 0 2px 16px rgba(15, 23, 42, .05) !important;
    overflow: hidden;
}

.alm-pro-page--sales #collapseFilter .box-header,
.alm-pro-page--products #collapseFilter .box-header,
.alm-pro-page--purchases #collapseFilter .box-header,
.alm-pro-page--contacts #collapseFilter .box-header {
    background: linear-gradient(to left, var(--mod-accent-soft), #fff) !important;
}

.alm-pro-page--sales #collapseFilter .box-header .box-title,
.alm-pro-page--products #collapseFilter .box-header .box-title,
.alm-pro-page--purchases #collapseFilter .box-header .box-title,
.alm-pro-page--contacts #collapseFilter .box-header .box-title {
    color: var(--mod-accent) !important;
    font-weight: 700 !important;
}

/* Data tables */
.alm-pro-page--sales .table-responsive,
.alm-pro-page--products .table-responsive,
.alm-pro-page--purchases .table-responsive,
.alm-pro-page--contacts .table-responsive {
    border-radius: 12px;
    overflow: hidden;
}

.alm-pro-page--sales table.table thead th,
.alm-pro-page--products table.table thead th,
.alm-pro-page--purchases table.table thead th,
.alm-pro-page--contacts table.table thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
    color: #334155 !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid var(--mod-accent-soft) !important;
    white-space: nowrap;
}

.alm-pro-page--sales table.table tbody tr:hover td,
.alm-pro-page--products table.table tbody tr:hover td,
.alm-pro-page--purchases table.table tbody tr:hover td,
.alm-pro-page--contacts table.table tbody tr:hover td {
    background: var(--mod-accent-soft) !important;
}

/* Products list — keep name column visible with scrollX */
.alm-pro-page--products #product_table th.product-name-cell,
.alm-pro-page--products #product_table td.product-name-cell {
    min-width: 220px !important;
    max-width: 340px;
    color: #0f172a !important;
    font-weight: 600;
    white-space: normal !important;
    word-break: break-word;
    vertical-align: middle !important;
}
.alm-pro-page--products #product_table .product-list-name strong {
    color: #0f172a !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}
.alm-pro-page--products #product_table .product-list-name small {
    color: #64748b !important;
    font-size: 11px;
}
[data-theme="dark"] .alm-pro-page--products #product_table th.product-name-cell,
[data-theme="dark"] .alm-pro-page--products #product_table td.product-name-cell,
[data-theme="dark"] .alm-pro-page--products #product_table .product-list-name strong {
    color: #f1f5f9 !important;
}

.alm-pro-page--sales .box-primary,
.alm-pro-page--products .box-primary,
.alm-pro-page--purchases .box-primary,
.alm-pro-page--contacts .box-primary {
    border-radius: 14px !important;
    border: 1px solid var(--alm-border, #e2e8f0) !important;
    box-shadow: 0 4px 24px rgba(15, 23, 42, .06) !important;
}

.alm-pro-page--sales .box-primary > .box-header,
.alm-pro-page--products .box-primary > .box-header,
.alm-pro-page--purchases .box-primary > .box-header,
.alm-pro-page--contacts .box-primary > .box-header {
    border-bottom: 1px solid var(--alm-border) !important;
    padding: 14px 18px !important;
}

.alm-pro-page--sales .box-primary > .box-header .box-title,
.alm-pro-page--products .box-primary > .box-header .box-title,
.alm-pro-page--purchases .box-primary > .box-header .box-title,
.alm-pro-page--contacts .box-primary > .box-header .box-title {
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
}

/* Primary action buttons in tables */
.alm-pro-page--sales .btn-primary,
.alm-pro-page--products .btn-primary,
.alm-pro-page--purchases .btn-primary {
    background: var(--mod-accent) !important;
    border-color: var(--mod-accent) !important;
    border-radius: 8px !important;
}

/* Select2 in module pages */
.alm-pro-page--sales .select2-container--default .select2-selection--single,
.alm-pro-page--products .select2-container--default .select2-selection--single,
.alm-pro-page--purchases .select2-container--default .select2-selection--single,
.alm-pro-page--contacts .select2-container--default .select2-selection--single {
    border-radius: 10px !important;
    border-color: #e2e8f0 !important;
    min-height: 38px !important;
}

/* Dark mode */
[data-theme="dark"] .alm-pro-page--sales,
[data-theme="dark"] .alm-pro-page--products,
[data-theme="dark"] .alm-pro-page--purchases,
[data-theme="dark"] .alm-pro-page--contacts {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="dark"] .alm-pro-page--sales table.table thead th,
[data-theme="dark"] .alm-pro-page--products table.table thead th,
[data-theme="dark"] .alm-pro-page--purchases table.table thead th,
[data-theme="dark"] .alm-pro-page--contacts table.table thead th {
    background: #334155 !important;
    color: #e2e8f0 !important;
}

@media (max-width: 767px) {
    .alm-pro-page--sales .alm-hero,
    .alm-pro-page--products .alm-hero,
    .alm-pro-page--purchases .alm-hero,
    .alm-pro-page--contacts .alm-hero {
        padding: 16px 18px;
    }

    .alm-pro-page--sales .alm-hero__title,
    .alm-pro-page--products .alm-hero__title,
    .alm-pro-page--purchases .alm-hero__title,
    .alm-pro-page--contacts .alm-hero__title {
        font-size: 1.2rem !important;
    }
}

/* ── Extended modules (reports, users, accounts, expense, inventory, settings) ─ */
.alm-pro-page--reports   { --mod-accent: #ea580c; --mod-accent-soft: #fff7ed; }
.alm-pro-page--users     { --mod-accent: #6366f1; --mod-accent-soft: #eef2ff; }
.alm-pro-page--accounts  { --mod-accent: #8b5cf6; --mod-accent-soft: #f5f3ff; }
.alm-pro-page--expense   { --mod-accent: #ef4444; --mod-accent-soft: #fef2f2; }
.alm-pro-page--inventory { --mod-accent: #10b981; --mod-accent-soft: #ecfdf5; }
.alm-pro-page--settings,
.alm-pro-page--catalog   { --mod-accent: #64748b; --mod-accent-soft: #f1f5f9; }

.alm-pro-page--system.alm-pro-page--reports .alm-hero,
.alm-pro-page--reports .alm-hero {
    background: linear-gradient(135deg, #c2410c 0%, #ea580c 100%);
}

.alm-pro-page--system.alm-pro-page--users .alm-hero {
    background: linear-gradient(135deg, #3730a3 0%, #6366f1 100%);
}

.alm-pro-page--system.alm-pro-page--expense .alm-hero {
    background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
}

.alm-pro-page--system.alm-pro-page--inventory .alm-hero {
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
}
