/*
|--------------------------------------------------------------------------
| POSTECH.CLOUD V4 - Operations Pages Polish
|--------------------------------------------------------------------------
| Sales / Purchases / Expenses / Customers & Suppliers
| Visual-only. No controllers, routes, DB, POS, printing logic.
*/

:root {
    --pc4-navy: #0d3155;
    --pc4-deep: #082540;
    --pc4-blue: #1678e8;
    --pc4-blue-soft: #3b98ff;
    --pc4-gold: #f2ad19;
    --pc4-bg: #f5f8fc;
    --pc4-card: #ffffff;
    --pc4-text: #17324f;
    --pc4-muted: #6c8197;
    --pc4-border: #d9e5f1;
    --pc4-border-soft: #e7eef5;
    --pc4-shadow: 0 8px 24px rgba(13,49,85,.07);
}

/* Shared canvas */
.postech-sales-page,
.postech-purchases-page,
.postech-expenses-page,
.postech-contacts-page {
    background: var(--pc4-bg) !important;
}

.postech-sales-page-header,
.postech-purchases-page-header,
.postech-expenses-page-header,
.postech-contacts-page-header {
    padding-bottom: 10px !important;
}

.postech-sales-page-header h1,
.postech-purchases-page-header h1,
.postech-expenses-page-header h1,
.postech-contacts-page-header h1 {
    color: var(--pc4-deep) !important;
    font-weight: 950 !important;
}

.postech-contacts-page-header h1 small {
    margin-inline-start: 8px !important;
    color: var(--pc4-muted) !important;
    font-weight: 700 !important;
}

/* Horizontal submenus */
.postech-sales-page .horizontal-scroll,
.postech-purchases-page .horizontal-scroll,
.postech-expenses-page .horizontal-scroll,
.postech-contacts-page .horizontal-scroll {
    height: 54px !important;
    min-height: 54px !important;
    margin-bottom: 15px !important;
    padding: 6px 7px !important;
    background: #fff !important;
    border: 1px solid var(--pc4-border) !important;
    border-radius: 12px !important;
    box-shadow: 0 5px 16px rgba(13,49,85,.05) !important;
    overflow: hidden !important;
}

.postech-sales-page .horizontal-scroll .storys-container,
.postech-purchases-page .horizontal-scroll .storys-container,
.postech-expenses-page .horizontal-scroll .storys-container,
.postech-contacts-page .horizontal-scroll .storys-container {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    width: 100% !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 0 !important;
    overflow-x: auto !important;
    scrollbar-width: thin;
}

.postech-sales-page .horizontal-scroll .sub-menu-item,
.postech-purchases-page .horizontal-scroll .sub-menu-item,
.postech-expenses-page .horizontal-scroll .sub-menu-item,
.postech-contacts-page .horizontal-scroll .sub-menu-item {
    flex: 0 0 auto !important;
    min-height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 8px 15px !important;
    color: #718499 !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
}

.postech-sales-page .horizontal-scroll .sub-menu-item:hover,
.postech-purchases-page .horizontal-scroll .sub-menu-item:hover,
.postech-expenses-page .horizontal-scroll .sub-menu-item:hover,
.postech-contacts-page .horizontal-scroll .sub-menu-item:hover {
    color: var(--pc4-blue) !important;
    background: #eef6ff !important;
    border-color: #c7def5 !important;
}

.postech-sales-page .horizontal-scroll .sub-menu-item.active,
.postech-purchases-page .horizontal-scroll .sub-menu-item.active,
.postech-expenses-page .horizontal-scroll .sub-menu-item.active,
.postech-contacts-page .horizontal-scroll .sub-menu-item.active {
    color: #fff !important;
    background: linear-gradient(135deg,var(--pc4-blue-soft),var(--pc4-blue)) !important;
    border-color: var(--pc4-blue) !important;
    box-shadow: inset 0 -3px 0 var(--pc4-gold) !important;
}

/* Cards and filters */
.postech-sales-page .box,
.postech-purchases-page .box,
.postech-expenses-page .box,
.postech-contacts-page .box {
    background: #fff !important;
    border: 1px solid var(--pc4-border) !important;
    border-radius: 14px !important;
    box-shadow: var(--pc4-shadow) !important;
    overflow: hidden !important;
}

.postech-sales-page .box-header,
.postech-purchases-page .box-header,
.postech-expenses-page .box-header,
.postech-contacts-page .box-header {
    min-height: 55px !important;
    padding: 13px 16px !important;
    color: var(--pc4-deep) !important;
    background: #fbfdff !important;
    border-bottom: 1px solid var(--pc4-border-soft) !important;
}

.postech-sales-page .box-title,
.postech-purchases-page .box-title,
.postech-expenses-page .box-title,
.postech-contacts-page .box-title {
    color: var(--pc4-deep) !important;
    font-size: 15px !important;
    font-weight: 950 !important;
}

.postech-sales-page .box-body,
.postech-purchases-page .box-body,
.postech-expenses-page .box-body,
.postech-contacts-page .box-body {
    padding: 14px 15px !important;
    background: #fff !important;
}

.postech-sales-page .form-group label,
.postech-purchases-page .form-group label,
.postech-expenses-page .form-group label,
.postech-contacts-page .form-group label {
    color: #36526e !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
}

.postech-sales-page .form-control,
.postech-purchases-page .form-control,
.postech-expenses-page .form-control,
.postech-contacts-page .form-control,
.postech-sales-page .select2-selection,
.postech-purchases-page .select2-selection,
.postech-expenses-page .select2-selection,
.postech-contacts-page .select2-selection {
    min-height: 37px !important;
    color: var(--pc4-text) !important;
    background: #fff !important;
    border: 1px solid #ceddea !important;
    border-radius: 8px !important;
}

/* Add buttons */
.postech-sales-page .box-tools .tw-dw-btn,
.postech-purchases-page .box-tools .tw-dw-btn,
.postech-expenses-page .box-tools .tw-dw-btn,
.postech-contacts-page .box-tools .tw-dw-btn {
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 14px !important;
    color: #fff !important;
    background: linear-gradient(135deg,var(--pc4-blue-soft),var(--pc4-blue)) !important;
    border: 1px solid #0f68ca !important;
    border-radius: 9px !important;
    box-shadow: 0 6px 15px rgba(22,120,232,.16) !important;
    font-size: 12px !important;
    font-weight: 900 !important;
}

/* Main tables */
#sell_table,
#purchase_table,
#expense_table,
#contact_table {
    width: 100% !important;
    background: #fff !important;
    border: 1px solid var(--pc4-border) !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
}

#sell_table thead th,
#purchase_table thead th,
#expense_table thead th,
#contact_table thead th {
    height: 45px !important;
    padding: 9px 10px !important;
    color: #3d5873 !important;
    background: #f1f6fb !important;
    border-top: 0 !important;
    border-bottom: 1px solid #d5e2ee !important;
    border-inline-end: 1px solid #e3eaf2 !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

#sell_table tbody td,
#purchase_table tbody td,
#expense_table tbody td,
#contact_table tbody td {
    padding: 9px 10px !important;
    color: #24415e !important;
    background: #fff !important;
    border-top: 0 !important;
    border-bottom: 1px solid #e7eef5 !important;
    border-inline-end: 1px solid #edf2f6 !important;
    font-size: 11.5px !important;
    font-weight: 650 !important;
    vertical-align: middle !important;
}

#sell_table tbody tr:nth-child(even) td,
#purchase_table tbody tr:nth-child(even) td,
#expense_table tbody tr:nth-child(even) td,
#contact_table tbody tr:nth-child(even) td {
    background: #fbfdff !important;
}

#sell_table tbody tr:hover td,
#purchase_table tbody tr:hover td,
#expense_table tbody tr:hover td,
#contact_table tbody tr:hover td {
    background: #eef6ff !important;
}

#sell_table tfoot td,
#purchase_table tfoot td,
#expense_table tfoot td,
#contact_table tfoot td {
    color: #405a73 !important;
    background: #f6f9fc !important;
    border-color: #dde7f0 !important;
    font-size: 11px !important;
    font-weight: 850 !important;
}

/* Status labels */
.postech-sales-page .label-success,
.postech-purchases-page .label-success,
.postech-expenses-page .label-success,
.postech-contacts-page .label-success {
    color: #0e754c !important;
    background: #eaf8f2 !important;
    border: 1px solid #caecde !important;
}

.postech-sales-page .label-warning,
.postech-purchases-page .label-warning,
.postech-expenses-page .label-warning,
.postech-contacts-page .label-warning {
    color: #8b5b00 !important;
    background: #fff5dc !important;
    border: 1px solid #f2d99b !important;
}

.postech-sales-page .label-danger,
.postech-purchases-page .label-danger,
.postech-expenses-page .label-danger,
.postech-contacts-page .label-danger {
    color: #9f2635 !important;
    background: #fff0f2 !important;
    border: 1px solid #f4cdd2 !important;
}

/* DataTables toolbar */
.postech-sales-page .dataTables_filter input,
.postech-purchases-page .dataTables_filter input,
.postech-expenses-page .dataTables_filter input,
.postech-contacts-page .dataTables_filter input {
    width: 190px !important;
    height: 37px !important;
    padding: 6px 10px !important;
    color: var(--pc4-text) !important;
    background: #fff !important;
    border: 1px solid #ceddea !important;
    border-radius: 8px !important;
}

.postech-sales-page .dataTables_length select,
.postech-purchases-page .dataTables_length select,
.postech-expenses-page .dataTables_length select,
.postech-contacts-page .dataTables_length select {
    height: 35px !important;
    min-width: 65px !important;
    color: var(--pc4-text) !important;
    background: #fff !important;
    border: 1px solid #ceddea !important;
    border-radius: 8px !important;
}

.postech-sales-page .dt-buttons .btn,
.postech-purchases-page .dt-buttons .btn,
.postech-expenses-page .dt-buttons .btn,
.postech-contacts-page .dt-buttons .btn,
.postech-sales-page .dt-button,
.postech-purchases-page .dt-button,
.postech-expenses-page .dt-button,
.postech-contacts-page .dt-button {
    width: 38px !important;
    min-width: 38px !important;
    height: 36px !important;
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 2px !important;
    color: var(--pc4-navy) !important;
    background: #f5f8fb !important;
    border: 1px solid #d3e0ec !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}

/* Pagination */
.postech-sales-page .pagination > li > a,
.postech-purchases-page .pagination > li > a,
.postech-expenses-page .pagination > li > a,
.postech-contacts-page .pagination > li > a,
.postech-sales-page .pagination > li > span,
.postech-purchases-page .pagination > li > span,
.postech-expenses-page .pagination > li > span,
.postech-contacts-page .pagination > li > span {
    min-width: 33px !important;
    height: 33px !important;
    margin: 0 2px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--pc4-navy) !important;
    background: #fff !important;
    border: 1px solid #d5e1ed !important;
    border-radius: 7px !important;
}

.postech-sales-page .pagination > .active > a,
.postech-purchases-page .pagination > .active > a,
.postech-expenses-page .pagination > .active > a,
.postech-contacts-page .pagination > .active > a,
.postech-sales-page .pagination > .active > span,
.postech-purchases-page .pagination > .active > span,
.postech-expenses-page .pagination > .active > span,
.postech-contacts-page .pagination > .active > span {
    color: #fff !important;
    background: var(--pc4-blue) !important;
    border-color: var(--pc4-blue) !important;
}

@media (max-width: 767px) {
    .postech-sales-page .dataTables_filter input,
    .postech-purchases-page .dataTables_filter input,
    .postech-expenses-page .dataTables_filter input,
    .postech-contacts-page .dataTables_filter input {
        width: 145px !important;
    }

    .postech-sales-page .horizontal-scroll .sub-menu-item,
    .postech-purchases-page .horizontal-scroll .sub-menu-item,
    .postech-expenses-page .horizontal-scroll .sub-menu-item,
    .postech-contacts-page .horizontal-scroll .sub-menu-item {
        padding: 8px 12px !important;
        font-size: 11px !important;
    }
}
