/* ============================================================
   Inventory Module — Compact Enterprise UI
   Target: SAP Fiori / Odoo Enterprise density at 100% zoom
   ============================================================ */

/* ============================================================
   DIALOG COMPACTNESS — applies to ALL Radzen dialogs globally
   ============================================================ */

/* Constrain dialog size — never wider than 90vw */
.rz-dialog {
    max-width: min(var(--rz-dialog-width, 860px), 90vw) !important;
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
}

.rz-dialog-wrapper {
    max-width: 90vw !important;
}

/* Dialog title bar */
.rz-dialog-titlebar {
    padding: 6px 14px !important;
    min-height: 36px !important;
}

.rz-dialog-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
}

.rz-dialog-close {
    width: 24px !important;
    height: 24px !important;
    font-size: 13px !important;
}

/* Dialog content area — allow internal scroll, reduce padding */
.rz-dialog-content {
    padding: 8px 12px !important;
    font-size: 12px !important;
    overflow-y: auto !important;
    max-height: calc(90vh - 90px) !important;
}

/* All text inside dialogs smaller */
.rz-dialog-content h5 {
    font-size: 13px !important;
    font-weight: 700 !important;
    margin-bottom: 2px !important;
}

.rz-dialog-content h6 {
    font-size: 12px !important;
    font-weight: 600 !important;
    margin-bottom: 2px !important;
}

.rz-dialog-content .text-muted {
    font-size: 11px !important;
}

/* Form labels inside dialogs */
.rz-dialog-content .form-label {
    font-size: 11px !important;
    margin-bottom: 2px !important;
    font-weight: 600;
}

/* Form controls inside dialogs */
.rz-dialog-content .form-control,
.rz-dialog-content .form-select {
    font-size: 12px !important;
    padding: 3px 7px !important;
    height: 28px !important;
}

/* Textarea still taller but compact */
.rz-dialog-content textarea.form-control {
    height: auto !important;
    min-height: 52px !important;
}

/* Buttons inside dialogs */
.rz-dialog-content .btn {
    font-size: 11px !important;
    padding: 3px 10px !important;
    border-radius: 4px !important;
}

.rz-dialog-content .btn-sm {
    font-size: 11px !important;
    padding: 2px 7px !important;
}

/* Reduce top margin of mb-3 blocks inside dialogs */
.rz-dialog-content .mb-3 {
    margin-bottom: 6px !important;
}

.rz-dialog-content .mb-4 {
    margin-bottom: 8px !important;
}

.rz-dialog-content .mt-3,
.rz-dialog-content .mt-4 {
    margin-top: 6px !important;
}

.rz-dialog-content .p-2 {
    padding: 6px !important;
}

.rz-dialog-content .p-3,
.rz-dialog-content .p-4 {
    padding: 8px !important;
}

/* Gap reductions */
.rz-dialog-content .gap-2 { gap: 5px !important; }
.rz-dialog-content .gap-3 { gap: 6px !important; }

/* Row/col spacing inside dialogs */
.rz-dialog-content .g-3 { --bs-gutter-y: 6px; --bs-gutter-x: 8px; }

/* Badge inside dialog */
.rz-dialog-content .badge {
    font-size: 10px !important;
    padding: 2px 6px !important;
}

/* Syncfusion grid inside dialog — extra compact */
.rz-dialog-content .e-grid .e-headercell {
    padding: 4px 6px !important;
    font-size: 11px !important;
}

.rz-dialog-content .e-grid .e-rowcell {
    padding: 3px 6px !important;
    font-size: 11px !important;
    line-height: 1.3 !important;
}

.rz-dialog-content .e-pager {
    padding: 2px 6px !important;
    font-size: 11px !important;
}

.rz-dialog-content .e-pager .e-pagercontainer {
    margin: 2px 0 !important;
}

/* Action row at bottom of dialog (totals / save buttons) */
.rz-dialog-content .d-flex.justify-content-end strong {
    font-size: 12px !important;
}

/* Dark-themed edit dialog form backgrounds */
.rz-dialog-content [style*="background:#1e2a38"],
.rz-dialog-content [style*="background: #1e2a38"] {
    border-radius: 6px !important;
    padding: 8px !important;
}

/* Radzen DatePicker inside dialog compact */
.rz-dialog-content .rz-datepicker .rz-inputtext,
.rz-dialog-content .rz-calendar .rz-inputtext {
    font-size: 12px !important;
    padding: 3px 7px !important;
    height: 28px !important;
}

/* Spinner inside saving button */
.rz-dialog-content .spinner-border-sm {
    width: 12px !important;
    height: 12px !important;
}

/* Alert inside dialog */
.rz-dialog-content .alert {
    padding: 5px 10px !important;
    font-size: 11px !important;
    margin-top: 6px !important;
}

/* ---- Compact workspace toolbar ---- */
.inv-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 12px;
    background: #2c3e50;
    border-radius: 6px;
    margin-bottom: 8px;
    min-height: 40px;
    flex-wrap: wrap;
}

.inv-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inv-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.inv-toolbar-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.inv-toolbar-title i {
    font-size: 14px;
}

.inv-toolbar-subtitle {
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    display: none; /* hidden on compact; show on md+ */
}

/* ---- Compact filter bar ---- */
.inv-filter-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: #f5f6f7;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.inv-filter-bar .form-control,
.inv-filter-bar .form-select {
    height: 28px;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #ced4da;
}

.inv-filter-bar label {
    font-size: 11px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0;
    white-space: nowrap;
}

.inv-filter-bar .rz-dropdown,
.inv-filter-bar .rz-calendar {
    font-size: 12px;
}

/* ---- Compact primary action button ---- */
.inv-btn-create {
    height: 28px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.inv-btn-create:hover {
    background: #219150;
    color: white;
}

/* ---- Compact secondary/outline buttons ---- */
.inv-btn-sm {
    height: 24px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.12s;
}

/* ---- Status badges — compact ---- */
.inv-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.inv-badge-draft   { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.inv-badge-pending { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.inv-badge-submit  { background: #d1e7dd; color: #0f5132; border: 1px solid #198754; }
.inv-badge-posted  { background: #d1e7dd; color: #0f5132; border: 1px solid #198754; }
.inv-badge-closed  { background: #cfe2ff; color: #084298; border: 1px solid #0d6efd; }
.inv-badge-cancel  { background: #e9ecef; color: #495057; border: 1px solid #adb5bd; }
.inv-badge-info    { background: #d3f3ff; color: #055160; border: 1px solid #0dcaf0; }
.inv-badge-danger  { background: #f8d7da; color: #842029; border: 1px solid #dc3545; }

/* ---- Grid container — compact ---- */
.inv-grid-wrapper {
    border: 1px solid #dee2e6;
    border-radius: 5px;
    overflow: hidden;
}

/* Reduce Syncfusion grid header + row height */
.inv-grid-wrapper .e-gridheader .e-headercell {
    padding: 4px 8px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    background: #f5f6f7 !important;
    color: #2c3e50 !important;
    border-bottom: 2px solid #dee2e6 !important;
}

.inv-grid-wrapper .e-gridcontent .e-rowcell {
    padding: 3px 8px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
}

.inv-grid-wrapper .e-grid .e-gridheader,
.inv-grid-wrapper .e-grid .e-gridcontent tr {
    height: 28px !important;
}

/* ---- Report sidebar list compact ---- */
.inv-report-sidebar {
    font-size: 12px;
}

.inv-report-sidebar .list-group-item {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 0;
}

.inv-report-sidebar .list-group-item.active {
    background: #2c3e50;
    border-color: #2c3e50;
}

/* ---- Report filter bar ---- */
.inv-report-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: #2c3e50;
    border-radius: 5px;
    color: white;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    flex-wrap: wrap;
}

.inv-report-header small {
    color: rgba(255,255,255,0.65);
    font-size: 11px;
}

/* ---- Radzen dropdown inside filter bar compact ---- */
.inv-filter-bar .rz-dropdown .rz-dropdown-label {
    padding: 2px 6px !important;
    font-size: 12px !important;
    height: 28px !important;
}

/* ---- Row actions compact ---- */
.inv-row-actions {
    display: flex;
    gap: 3px;
    align-items: center;
}

/* ---- Posting monitor toolbar (no big header) ---- */
.inv-posting-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 5px 0;
    margin-bottom: 6px;
}

.inv-posting-toolbar .form-control,
.inv-posting-toolbar .form-select {
    height: 28px;
    font-size: 12px;
    padding: 2px 8px;
}

/* ---- POS Integration toolbar ---- */
.inv-pos-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    padding: 5px 0;
    margin-bottom: 6px;
}

.inv-pos-toolbar label {
    font-size: 11px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 2px;
}

.inv-pos-toolbar .form-control {
    height: 28px;
    font-size: 12px;
    padding: 2px 8px;
}

/* ---- Additional badge variants ---- */
.inv-badge-info { background: #17a2b8; color: #fff; }
.inv-badge-posted { background: #28a745; color: #fff; }
.inv-badge-cancel { background: #6c757d; color: #fff; }

/* ---- Report two-panel layout ---- */
.inv-report-layout {
    display: flex;
    gap: 0;
    height: calc(100vh - 130px);
    overflow: hidden;
}

.inv-report-sidebar {
    width: 180px;
    min-width: 160px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    padding: 4px 0;
    background: #f8f9fa;
}

.inv-report-nav-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 12px;
    border: none;
    background: transparent;
    font-size: 12px;
    color: #495057;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: background 0.15s;
}

.inv-report-nav-item:hover { background: #e9ecef; }
.inv-report-nav-item.active {
    background: #e3eaf4;
    color: #2c3e50;
    border-left-color: #2c3e50;
    font-weight: 600;
}

.inv-report-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 8px;
}

.inv-report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 5px 8px;
    background: #2c3e50;
    border-radius: 5px;
    margin-bottom: 6px;
    flex-wrap: wrap;
    min-height: 38px;
}

.inv-report-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-wrap: wrap;
}

.inv-report-header-right {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.inv-report-header-right .form-control,
.inv-report-header-right .form-select {
    height: 26px;
    font-size: 11px;
    padding: 2px 6px;
}

.inv-report-header-right .inv-btn-create {
    height: 26px;
    font-size: 11px;
    padding: 0 10px;
}
