/*
 * Compact operational-page scale.
 * Scoped by base.html to selected oversized ERP screens only.
 */

.compact-erp-page main {
    font-size: .875rem;
    line-height: 1.35;
}

.compact-erp-page main h1 {
    font-size: 1.375rem;
    line-height: 1.2;
}

.compact-erp-page main h2 {
    font-size: 1.25rem;
    line-height: 1.25;
}

.compact-erp-page main h3 {
    font-size: 1.05rem;
    line-height: 1.25;
}

.compact-erp-page main h4,
.compact-erp-page main h5,
.compact-erp-page main h6 {
    font-size: .9375rem;
    line-height: 1.3;
}

.compact-erp-page .main-content.p-4 {
    padding: 1rem !important;
}

.compact-erp-page main .container[style*="margin-top: 20px"] {
    margin-top: 12px !important;
}

.compact-erp-page main .container-fluid.py-4 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.compact-erp-page main .row.mb-4,
.compact-erp-page main .nav.mb-4 {
    margin-bottom: .75rem !important;
}

.compact-erp-page main .breadcrumb-nav {
    margin-bottom: 12px;
}

.compact-erp-page main .nav-btn {
    padding: 7px 10px;
    font-size: .8125rem;
}

.compact-erp-page main .section-card {
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(31, 38, 135, .10);
    transition: box-shadow .15s ease;
}

.compact-erp-page main .section-card:hover {
    transform: none;
    box-shadow: 0 4px 14px rgba(31, 38, 135, .12);
}

.compact-erp-page main .section-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom-width: 1px;
}

.compact-erp-page main .section-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 16px;
    margin-right: 10px;
}

.compact-erp-page main .section-title {
    font-size: 1.125rem;
}

.compact-erp-page main .menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
}

.compact-erp-page main .menu-item {
    padding: 12px;
    border-radius: 8px;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.compact-erp-page main .menu-item:hover {
    transform: none;
    box-shadow: 0 3px 10px rgba(255, 107, 53, .18);
}

.compact-erp-page main .menu-item-icon {
    margin-bottom: 6px;
    font-size: 18px;
}

.compact-erp-page main .menu-item-title {
    margin-bottom: 3px;
    font-size: .9375rem;
}

.compact-erp-page main .menu-item-desc {
    font-size: .8125rem;
    line-height: 1.3;
}

/* Long-form settings pages */
.compact-erp-page main .form-section {
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 8px;
}

.compact-erp-page main .form-section-title {
    margin-bottom: 8px;
    padding-bottom: 6px;
    font-size: .9375rem;
}

.compact-erp-page main .form-check-inline-group {
    gap: 8px;
}

.compact-erp-page main .form-check-custom {
    padding: 6px 10px;
    margin-bottom: 6px;
    border-radius: 6px;
}

.compact-erp-page main .form-check-custom input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin-right: 7px;
}

.compact-erp-page main .form-label,
.compact-erp-page main label,
.compact-erp-page main .btn,
.compact-erp-page main button,
.compact-erp-page main input,
.compact-erp-page main select,
.compact-erp-page main textarea {
    font-size: .8125rem;
}

.compact-erp-page main .form-control,
.compact-erp-page main .form-select {
    min-height: 38px;
    padding: .375rem .625rem;
}

.compact-erp-page main .form-label {
    margin-bottom: .25rem;
}

.compact-erp-page main .btn-save {
    padding: 8px 16px;
    border-radius: 6px;
}

.compact-erp-page main .back-btn {
    padding: 7px 12px;
    border-radius: 6px;
    font-size: .8125rem;
}

.compact-erp-page main .nav-pills .nav-link {
    margin-right: 6px;
    padding: .45rem .75rem;
    border-radius: 6px;
    font-size: .8125rem;
}

/* Global configurations value matrix */
.compact-erp-page main .config-grid {
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 8px;
}

.compact-erp-page main .config-item {
    min-height: 56px;
    padding: 8px 6px;
    border-radius: 8px;
}

.compact-erp-page main .config-label {
    margin-bottom: 3px;
    font-size: .6875rem;
}

.compact-erp-page main .config-value {
    font-size: .9375rem;
}

.compact-erp-page main .empty-state {
    padding: 32px 16px;
}

.compact-erp-page main .empty-state i {
    margin-bottom: 12px;
    font-size: 2.5rem;
}

/* Company and branch management uses its own larger component family. */
.compact-erp-page main .header-section {
    padding: 12px 20px;
}

.compact-erp-page main .module-icon-header {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    border-radius: 10px;
    font-size: 18px;
}

.compact-erp-page main .header-title {
    font-size: 1.375rem;
}

.compact-erp-page main .header-subtitle {
    margin-top: 2px;
    font-size: .8125rem;
}

.compact-erp-page main .content-area {
    padding: 20px;
}

.compact-erp-page main .company-section,
.compact-erp-page main .branch-section {
    margin-bottom: 20px;
}

.compact-erp-page main .branch-count {
    font-size: .875rem;
}

.compact-erp-page main .edit-btn,
.compact-erp-page main .add-btn,
.compact-erp-page main .manage-btn {
    padding: 6px 10px;
    font-size: .8125rem;
}

.compact-erp-page main .company-card {
    border-radius: 10px;
}

.compact-erp-page main .company-header {
    padding: 16px;
}

.compact-erp-page main .company-logo {
    width: 56px;
    height: 56px;
    margin-right: 16px;
    font-size: 24px;
}

.compact-erp-page main .company-logo img,
.compact-erp-page main .company-logo > div {
    width: 56px !important;
    height: 56px !important;
    border-radius: 9px !important;
    font-size: 24px !important;
}

.compact-erp-page main .company-name {
    font-size: 1.25rem;
}

.compact-erp-page main .company-id {
    margin-bottom: 6px;
    font-size: .75rem;
}

.compact-erp-page main .company-slogan {
    font-size: .875rem;
}

.compact-erp-page main .company-details {
    padding: 16px;
}

.compact-erp-page main .detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.compact-erp-page main .company-vision-mission {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
}

.compact-erp-page main .branch-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
}

.compact-erp-page main .branch-card {
    border-radius: 8px;
}

.compact-erp-page main .branch-header {
    padding: 12px;
}

.compact-erp-page main .branch-icon {
    width: 36px;
    height: 36px;
    margin-right: 10px;
    border-radius: 8px;
    font-size: 16px;
}

.compact-erp-page main .branch-name {
    font-size: .9375rem;
}

.compact-erp-page main .branch-code {
    font-size: .75rem;
}

.compact-erp-page main .branch-details {
    padding: 12px;
}

.compact-erp-page main .branch-detail {
    margin-bottom: 4px;
    font-size: .8125rem;
}

.compact-erp-page main .branch-actions {
    gap: 6px;
    padding: 10px 12px 12px;
}

.compact-erp-page main .action-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    font-size: 12px;
}

.compact-erp-page main .management-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.compact-erp-page main .management-card {
    padding: 16px;
}

.compact-erp-page main .card-header-custom {
    margin-bottom: 12px;
}

.compact-erp-page main .card-icon {
    width: 42px;
    height: 42px;
    margin-right: 12px;
    border-radius: 9px;
    font-size: 19px;
}

.compact-erp-page main .card-title {
    font-size: 1.125rem;
}

.compact-erp-page main .card-subtitle {
    font-size: .8125rem;
}

.compact-erp-page main .card-description {
    margin-bottom: 16px;
    font-size: .875rem;
    line-height: 1.4;
}

.compact-erp-page main .card-features {
    margin-bottom: 16px;
}

.compact-erp-page main .card-features li {
    padding: 4px 0;
    font-size: .8125rem;
}

.compact-erp-page main .action-buttons {
    gap: 8px;
}

.compact-erp-page main .btn-primary-custom {
    min-width: 112px;
    padding: 8px 12px;
    font-size: .8125rem;
}

.compact-erp-page main .btn-outline-custom {
    min-width: 100px;
    padding: 6px 10px;
    font-size: .8125rem;
}

/*
 * Inventory CRUD density.
 * These pages use the legacy .crud-* family, which is shared by unrelated
 * modules. Keep the tighter geometry behind an inventory-only body class.
 */
.inventory-crud-page .main-content.p-4 {
    padding: .75rem !important;
}

.inventory-crud-page main .crud-container {
    padding: .75rem;
}

.inventory-crud-page main .crud-header {
    margin-bottom: .75rem;
}

.inventory-crud-page main .crud-icon {
    width: 32px;
    height: 32px;
    margin-right: .625rem;
    border-radius: 7px;
}

.inventory-crud-page main .crud-icon i {
    font-size: .875rem;
}

.inventory-crud-page main .crud-title {
    font-size: 1.125rem;
    line-height: 1.2;
}

.inventory-crud-page main .crud-subtitle {
    font-size: .75rem;
    line-height: 1.25;
}

.inventory-crud-page main .crud-header-actions {
    gap: .375rem;
}

.inventory-crud-page main .crud-header-actions .btn {
    min-height: 32px;
    padding: .3rem .625rem;
    font-size: .75rem;
}

.inventory-crud-page main .crud-header-actions .btn .me-2 {
    margin-right: .35rem !important;
}

.inventory-crud-page main .crud-stats-container {
    padding: .75rem;
    margin-bottom: .75rem;
    border-radius: 10px;
}

.inventory-crud-page main .crud-stats-container .row {
    --bs-gutter-x: .75rem;
    --bs-gutter-y: .5rem;
}

.inventory-crud-page main .crud-stat-number {
    font-size: 1.5rem;
}

.inventory-crud-page main .crud-stat-label {
    font-size: .75rem;
    margin-top: .25rem;
}

.inventory-crud-page main .crud-card {
    border-radius: 10px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .08);
}

.inventory-crud-page main .crud-card:hover {
    transform: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .1);
}

.inventory-crud-page main .crud-card-header {
    padding: .75rem;
    border-radius: 10px 10px 0 0 !important;
}

.inventory-crud-page main .crud-card-header h5 {
    font-size: .9375rem;
}

.inventory-crud-page main .crud-card-header .form-control,
.inventory-crud-page main .crud-card-header .form-select {
    min-height: 30px;
    padding: .25rem .5rem;
    font-size: .75rem;
}

.inventory-crud-page main .crud-card-header .btn {
    min-height: 30px;
    padding: .25rem .5rem;
    font-size: .75rem;
}

.inventory-crud-page main .crud-card-header .badge {
    font-size: .6875rem;
}

.inventory-crud-page main .crud-table {
    font-size: .8125rem;
    border-radius: 10px;
}

.inventory-crud-page main .crud-table thead th {
    padding: .55rem .625rem;
    font-size: .75rem;
    line-height: 1.2;
    white-space: nowrap;
}

.inventory-crud-page main .crud-table tbody td {
    padding: .55rem .625rem;
    line-height: 1.25;
}

.inventory-crud-page main .crud-action-btn {
    padding: .2rem .4rem;
    font-size: .75rem;
}

/* Price Manager uses a Bootstrap table rather than .crud-table. */
.inventory-crud-page main #pricesTable {
    font-size: .8125rem;
}

.inventory-crud-page main #pricesTable thead th {
    padding: .55rem .625rem;
    font-size: .75rem;
    line-height: 1.2;
    white-space: nowrap;
}

.inventory-crud-page main #pricesTable tbody td {
    padding: .55rem .625rem;
    line-height: 1.25;
    vertical-align: middle;
}

.inventory-crud-page main .crud-card.mt-3 {
    margin-top: .75rem !important;
}

.inventory-crud-page main .crud-card-body.p-4 {
    padding: .75rem !important;
}

.inventory-crud-page main .crud-card-body .form-label {
    margin-bottom: .2rem;
    font-size: .75rem;
}

.inventory-crud-page main .crud-card-body .form-control,
.inventory-crud-page main .crud-card-body .form-select {
    min-height: 32px;
    padding: .25rem .5rem;
    font-size: .8125rem;
}

.inventory-crud-page main .crud-card-body .btn {
    min-height: 32px;
    padding: .3rem .625rem;
    font-size: .75rem;
}

/*
 * Inventory standard layout.
 * Older Inventory operation/master pages use Bootstrap .container wrappers
 * and full-size controls. Keep their page-specific behavior, but align their
 * shell with the newer full-width compact operation pages.
 */
.inventory-standard-page .main-content.p-4 {
    padding: .75rem !important;
}

.inventory-standard-page .main-content > .container,
.inventory-standard-page .main-content > .container-fluid,
.compact-erp-page .main-content > .container {
    width: 100%;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.inventory-standard-page .main-content > .container,
.inventory-standard-page .main-content > .container-fluid,
.compact-erp-page .main-content > .container {
    margin-top: 12px !important;
}

.inventory-standard-page .main-content .stock-card,
.inventory-standard-page .main-content .section-card,
.inventory-standard-page .main-content .kf-card {
    padding: 16px 20px;
    margin-bottom: 16px;
    border-radius: 10px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .08);
}

.inventory-standard-page .main-content .section-card:hover {
    transform: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .1);
}

.inventory-standard-page .main-content .section-header,
.inventory-standard-page .main-content .kf-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom-width: 1px;
}

.inventory-standard-page .main-content .section-icon,
.inventory-standard-page .main-content .kf-icon {
    width: 38px;
    height: 38px;
    margin-right: 10px;
    border-radius: 8px;
    font-size: 16px;
}

.inventory-standard-page .main-content .section-title,
.inventory-standard-page .main-content .kf-title {
    font-size: 1.1rem;
}

.inventory-standard-page .main-content .breadcrumb-nav .nav-btn,
.inventory-standard-page .main-content > .container > .mb-3 > .btn,
.inventory-standard-page .main-content > .container-fluid > .mb-3 > .btn,
.compact-erp-page .main-content .breadcrumb-nav .nav-btn {
    min-height: 30px;
    padding: .3rem .6rem;
    font-size: .75rem;
}

.inventory-standard-page .main-content .stock-card .btn,
.inventory-standard-page .main-content .section-card .btn,
.inventory-standard-page .main-content .kf-card .btn {
    min-height: 32px;
    padding: .3rem .65rem;
    font-size: .75rem;
}

.inventory-standard-page .main-content .btn-lg {
    min-height: 34px;
    padding: .35rem .75rem;
    font-size: .8125rem;
}

.inventory-standard-page .main-content .card-header {
    padding: .55rem .75rem;
}

.inventory-standard-page .main-content .card-body {
    padding: .75rem;
}

.inventory-standard-page .main-content #wasteForm .btn {
    min-height: 32px;
    padding: .3rem .65rem;
    font-size: .75rem;
}

.compact-erp-page .main-content .section-card {
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 10px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .08);
}

.compact-erp-page .main-content .section-card:hover {
    transform: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .1);
}

.compact-erp-page .main-content .section-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom-width: 1px;
}

.compact-erp-page .main-content .section-icon {
    width: 38px;
    height: 38px;
    margin-right: 10px;
    border-radius: 8px;
    font-size: 16px;
}

.compact-erp-page .main-content .section-title {
    font-size: 1.1rem;
}

.compact-erp-page .main-content .menu-grid {
    gap: 10px;
}

.compact-erp-page .main-content .menu-item {
    padding: 14px;
    border-radius: 10px;
}

.compact-erp-page .main-content .menu-item-icon {
    margin-bottom: 7px;
    font-size: 20px;
}

.compact-erp-page .main-content .menu-item-title {
    font-size: .95rem;
}

.compact-erp-page .main-content .menu-item-desc {
    font-size: .8rem;
}

@media (max-width: 767.98px) {
    .compact-erp-page .main-content.p-4 {
        padding: .75rem !important;
    }

    .compact-erp-page main .content-area {
        padding: 12px;
    }

    .compact-erp-page main .menu-grid,
    .compact-erp-page main .detail-grid,
    .compact-erp-page main .company-vision-mission,
    .compact-erp-page main .branch-grid,
    .compact-erp-page main .management-grid {
        grid-template-columns: 1fr;
    }
}