/* ============================================================
   Hokkie Custom Overrides — Clean Build for Filament v4.11.6
   ============================================================ */

/* ===== Global font size ===== */
html { font-size: 112.5% !important; }

/* ===== Sidebar abu muda ===== */
.fi-sidebar,
.fi-sidebar-nav,
aside.fi-sidebar {
    background-color: rgb(243 244 246) !important;
}
.dark .fi-sidebar,
.dark .fi-sidebar-nav {
    background-color: rgb(31 41 55) !important;
}

/* ===== Card / Section padding & gap ===== */
.fi-section {
    border-radius: 0.125rem !important;
}
.fi-section-content-ctn {
    padding: 0.5rem 0.75rem !important;
}
/* Gap antar card */
.fi-form > *,
[class*="fi-form-component-ctn"] {
    margin-bottom: 0.125rem !important;
}
/* Section header (Informasi Nota, etc) compact + icon align */
.fi-section-header {
    padding: 0.25rem 0.5rem !important;
    min-height: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}
.fi-section-header-heading {
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
    margin: 0 !important;
}
.fi-section-header svg {
    width: 1rem !important;
    height: 1rem !important;
}

/* ===== Form field wrappers compact ===== */
.fi-fo-field-wrp,
.fi-fo-field {
    margin-bottom: 0 !important;
}
.fi-fo-field-label {
    font-size: 0.75rem !important;
    margin-bottom: 0.15rem !important;
}

/* ===== Input & Select height match ===== */
.fi-input,
.fi-select-input-btn,
.fi-fo-date-time-picker-display-text-input,
select.fi-select-input {
    min-height: 2.25rem !important;
    height: 2.25rem !important;
    font-size: 0.875rem !important;
    box-sizing: border-box !important;
}

/* ============================================================
   SELECT v4.11.6 — Correct structure
   .fi-input-wrp.fi-fo-select (flex container)
     ├── .fi-input-wrp-content-ctn (Select widget — flex 1)
     │     └── .fi-select-input-btn (trigger button)
     │           └── .fi-select-input-value-ctn → text
     │     └── .fi-dropdown-panel (dropdown)
     └── .fi-input-wrp-suffix (optional "+" button)
           └── .fi-input-wrp-actions
                 └── .fi-icon-btn
   ============================================================ */

/* Container row layout */
.fi-input-wrp.fi-fo-select {
    display: flex !important;
    align-items: stretch !important;
    width: 100% !important;
}
.fi-input-wrp.fi-fo-select > .fi-input-wrp-content-ctn {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

/* Select widget root fill content area */
.fi-input-wrp.fi-fo-select .fi-select-input,
.fi-input-wrp.fi-fo-select .fi-select-input > div,
.fi-input-wrp.fi-fo-select .fi-select-input-ctn {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Trigger button fill width */
.fi-select-input-btn {
    width: 100% !important;
    text-align: left !important;
    display: flex !important;
    align-items: center !important;
}

/* Value/placeholder text container — flex grow + vertical center */
.fi-select-input-value-ctn {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    line-height: 1.25rem !important;
}
.fi-select-input-placeholder,
.fi-select-input-value-label {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Dropdown panel match trigger width */
.fi-select-input-ctn .fi-dropdown-panel {
    width: 100% !important;
    min-width: 100% !important;
}

/* Suffix area (tombol "+" createOption) - kecil, tidak stretch */
.fi-input-wrp-suffix,
.fi-input-wrp-actions {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
}
.fi-input-wrp-actions .fi-icon-btn,
.fi-input-wrp-suffix .fi-icon-btn {
    width: 2.25rem !important;
    height: 2.25rem !important;
    flex: 0 0 2.25rem !important;
    padding: 0.375rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ============================================================
   REPEATER TABLE
   ============================================================ */
.fi-fo-table-repeater table {
    border-collapse: collapse !important;
}
.fi-fo-table-repeater table thead th {
    text-align: center !important;
    border: 0 !important;
    background: rgb(243 244 246) !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    padding: 0.4rem 0.4rem !important;
    color: rgb(75 85 99) !important;
}
.dark .fi-fo-table-repeater table thead th {
    background: rgb(31 41 55) !important;
}
.fi-fo-table-repeater table tbody td {
    border: 0 !important;
    padding: 0.25rem 0.3rem !important;
}
/* Hilangkan vertical border antar kolom */
.fi-fo-table-repeater table th,
.fi-fo-table-repeater table td {
    border-left: 0 !important;
    border-right: 0 !important;
    border-inline: 0 !important;
}
/* Action column kecil */
.fi-fo-table-repeater-empty-header-cell,
.fi-fo-table-repeater-actions {
    width: 50px !important;
}
.fi-fo-table-repeater table tbody td:last-child {
    width: 50px !important;
    padding: 0.25rem !important;
}

/* ============================================================
   FILE UPLOAD — single dashed border
   ============================================================ */
.fi-fo-file-upload {
    border: 1px dashed rgb(209 213 219) !important;
    border-radius: 0.125rem !important;
    padding: 0.5rem !important;
    background: transparent !important;
}
.fi-fo-file-upload *,
.fi-fo-file-upload .filepond--root,
.fi-fo-file-upload .filepond--panel,
.fi-fo-file-upload .filepond--panel-root,
.fi-fo-file-upload .filepond--drop-label {
    border: 0 !important;
    border-width: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}
.fi-fo-file-upload .filepond--root {
    min-height: 10rem !important;
}

/* ===== Input & Select border-radius compact ===== */
.fi-input-wrp,
.fi-input,
.fi-select-input-btn,
.fi-fo-date-time-picker-trigger,
.fi-fo-date-time-picker-display-text-input,
textarea.fi-input,
select.fi-select-input {
    border-radius: 0.125rem !important;
}

/* ===== Repeater container card border-radius ===== */
.fi-fo-repeater,
.fi-fo-table-repeater,
.fi-fo-table-repeater table,
.fi-fo-repeater [class*="fi-fo-repeater-items"],
.fi-fo-repeater [class*="fi-fo-repeater-item"] {
    border-radius: 0.125rem !important;
}







/* ===== "Add to items" button repeater rata kanan ===== */
.fi-fo-table-repeater-add,
.fi-fo-repeater-add {
    display: flex !important;
    justify-content: flex-end !important;
}

/* ===== Form actions bottom (Create/Cancel) rata kanan ===== */
.fi-sc-actions .fi-ac,
.fi-ac.fi-align-start {
    justify-content: flex-end !important;
}

/* ===== Reduce space di atas Repeater (Items) ===== */
.fi-fo-table-repeater,
.fi-fo-repeater {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
/* Sc-component wrapper tighten */
.fi-sc-component {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
/* Schema component container gap tighten */
.fi-sc.fi-sc-has-gap {
    gap: 0.375rem !important;
}
.fi-grid {
    gap: 0.375rem !important;
}





/* ===== Input dengan prefix/suffix (Rp, %, dll) - input area cukup lebar ===== */
.fi-input-wrp.fi-fo-text-input {
    display: flex !important;
    align-items: stretch !important;
}
.fi-input-wrp-prefix,
.fi-input-wrp-suffix {
    flex: 0 0 auto !important;
    padding: 0 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    background: rgb(243 244 246) !important;
    color: rgb(75 85 99) !important;
    border-right: 1px solid rgb(229 231 235) !important;
    white-space: nowrap !important;
}
.fi-input-wrp-content-ctn {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
}
.fi-input-wrp-content-ctn input.fi-input,
.fi-input-wrp-content-ctn .fi-input {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

/* ===== Input dengan prefix/suffix (Rp, %, dll) - input area cukup lebar ===== */
.fi-input-wrp.fi-fo-text-input {
    display: flex !important;
    align-items: stretch !important;
}
.fi-input-wrp-prefix,
.fi-input-wrp-suffix {
    flex: 0 0 auto !important;
    padding: 0 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    background: rgb(243 244 246) !important;
    color: rgb(75 85 99) !important;
    border-right: 1px solid rgb(229 231 235) !important;
    white-space: nowrap !important;
}
.fi-input-wrp-content-ctn {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
}
.fi-input-wrp-content-ctn input.fi-input,
.fi-input-wrp-content-ctn .fi-input {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
}




/* ===== Form field di modal stretch full width ===== */
.fi-modal-window .fi-section,
.fi-modal-window .fi-section-content,
.fi-modal-window .fi-fo-component-ctn,
.fi-modal-window .fi-fo-field-wrp {
    width: 100% !important;
    max-width: none !important;
}
.fi-modal-window .fi-grid,
.fi-modal-window .fi-section-content > div {
    width: 100% !important;
}
.fi-modal-window .fi-input-wrp,
.fi-modal-window .fi-input,
.fi-modal-window textarea.fi-input {
    width: 100% !important;
}

/* ===== Form field di modal stretch full width ===== */
.fi-modal-window .fi-section,
.fi-modal-window .fi-section-content,
.fi-modal-window .fi-fo-component-ctn,
.fi-modal-window .fi-fo-field-wrp {
    width: 100% !important;
    max-width: none !important;
}
.fi-modal-window .fi-grid,
.fi-modal-window .fi-section-content > div {
    width: 100% !important;
}
.fi-modal-window .fi-input-wrp,
.fi-modal-window .fi-input,
.fi-modal-window textarea.fi-input {
    width: 100% !important;
}

/* ===== FileUpload compact di table repeater piece ===== */
.fi-fo-table-repeater .fi-fo-file-upload {
    min-height: auto !important;
}
.fi-fo-table-repeater .fi-fo-file-upload-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)) !important;
    gap: 4px !important;
}
.fi-fo-table-repeater .filepond--root {
    margin: 0 !important;
    min-height: 60px !important;
}
.fi-fo-table-repeater .filepond--panel-root {
    min-height: 60px !important;
}
.fi-fo-table-repeater .filepond--drop-label {
    min-height: 60px !important;
    padding: 0.5rem !important;
    font-size: 0.7rem !important;
}
.fi-fo-table-repeater .filepond--drop-label label {
    cursor: pointer !important;
}
/* Preview thumbnail kecil */
.fi-fo-table-repeater .filepond--item {
    width: 60px !important;
    height: 60px !important;
}

/* ===================================================================
   FOTO UPLOAD WIDGET — Modal + Thumbnails
=================================================================== */

[x-cloak] { display: none !important; }

/* Cell foto di table piece */
.piece-foto-cell {
    width: 100%;
}
.piece-foto-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    min-height: 50px;
}
.piece-foto-thumb-wrap {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgb(229 231 235);
    cursor: pointer;
}
.piece-foto-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.15s;
}
.piece-foto-thumb-wrap:hover .piece-foto-thumb {
    transform: scale(1.05);
}
.piece-foto-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 50px;
    height: 50px;
    border: 1px dashed rgb(156 163 175);
    border-radius: 4px;
    background: rgb(249 250 251);
    color: rgb(75 85 99);
    cursor: pointer;
    font-size: 0.65rem;
    transition: all 0.15s;
}
.piece-foto-add:hover {
    border-color: rgb(59 130 246);
    background: rgb(239 246 255);
    color: rgb(37 99 235);
}

/* Modal overlay */
.foto-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Modal box */
.foto-modal-box {
    background: white;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

/* Header */
.foto-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgb(75 85 99);
    color: white;
}
.foto-modal-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}
.foto-modal-close {
    background: transparent;
    border: 0;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.25rem;
}
.foto-modal-close:hover { opacity: 0.7; }

/* Tabs */
.foto-modal-tabs {
    display: flex;
    border-bottom: 1px solid rgb(229 231 235);
}
.foto-modal-tabs button {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    color: rgb(75 85 99);
    font-size: 0.85rem;
    transition: all 0.15s;
}
.foto-modal-tabs button:hover {
    background: rgb(243 244 246);
}
.foto-modal-tabs button.active {
    color: rgb(37 99 235);
    border-bottom-color: rgb(37 99 235);
    font-weight: 600;
}

/* Body */
.foto-modal-body {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    position: relative;
}

/* Dropzone */
.foto-dropzone {
    border: 2px dashed rgb(209 213 219);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    color: rgb(75 85 99);
    transition: all 0.15s;
}
.foto-dropzone:hover,
.foto-dropzone.drag-active {
    border-color: rgb(37 99 235);
    background: rgb(239 246 255);
    color: rgb(37 99 235);
}
.foto-dropzone svg {
    margin: 0 auto;
    display: block;
    opacity: 0.6;
}

/* Webcam */
.foto-webcam-wrap {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: rgb(17 24 39);
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(156 163 175);
}
.foto-webcam-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.foto-webcam-placeholder,
.foto-webcam-error {
    text-align: center;
    padding: 1rem;
}
.foto-webcam-error {
    color: rgb(252 165 165);
}
.foto-capture-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem auto 0;
    padding: 0.5rem 1.5rem;
    background: rgb(37 99 235);
    color: white;
    border: 0;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
}
.foto-capture-btn:hover { background: rgb(29 78 216); }
.foto-capture-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Preview section */
.foto-preview-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgb(229 231 235);
}
.foto-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}
.foto-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 0.25rem;
    overflow: hidden;
    border: 1px solid rgb(229 231 235);
}
.foto-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.foto-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: 0;
    cursor: pointer;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.foto-preview-remove:hover { background: rgb(185 28 28); }

/* Uploading overlay */
.foto-uploading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: rgb(37 99 235);
}

/* Footer */
.foto-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgb(229 231 235);
    background: rgb(249 250 251);
}
.foto-btn-secondary {
    padding: 0.4rem 1rem;
    background: white;
    border: 1px solid rgb(209 213 219);
    border-radius: 0.375rem;
    cursor: pointer;
    color: rgb(75 85 99);
    font-size: 0.85rem;
}
.foto-btn-secondary:hover {
    background: rgb(243 244 246);
}

/* ===================================================================
   FOTO PRIMARY indicator & button
=================================================================== */
.foto-preview-item.is-primary {
    border: 2px solid #f59e0b !important;
    box-shadow: 0 0 0 2px rgba(245,158,11,0.2);
}
.foto-primary-badge {
    position: absolute;
    bottom: 2px;
    left: 2px;
    background: rgba(245,158,11,0.95);
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 3px;
    letter-spacing: 0.3px;
}
.foto-preview-setprimary {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(245,158,11,0.85);
    color: white;
    border: 0;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
}
.foto-preview-item:hover .foto-preview-setprimary {
    opacity: 1;
}
.foto-preview-setprimary:hover {
    background: rgb(217 119 6);
}

/* Primary indicator di thumbnail di table cell */
.piece-foto-thumb-wrap:first-child {
    border-color: #f59e0b !important;
    border-width: 2px !important;
}
.piece-foto-thumb-wrap:first-child::after {
    content: '★';
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(245,158,11,0.9);
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 0 2px;
    border-radius: 2px 0 0 0;
    line-height: 1.2;
}

/* ===================================================================
   FOTO UPLOAD v2: max 3, sortable, visible delete
=================================================================== */

/* Max foto warning */
.foto-max-warning {
    padding: 0.75rem;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 0.375rem;
    color: #92400e;
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

/* Delete button bigger + always visible + clearer */
.foto-preview-remove {
    position: absolute !important;
    top: 4px !important;
    right: 4px !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    background: rgb(220 38 38) !important;
    color: white !important;
    border: 2px solid white !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    transition: transform 0.15s !important;
    z-index: 5 !important;
    opacity: 1 !important;
}
.foto-preview-remove:hover {
    background: rgb(185 28 28) !important;
    transform: scale(1.1) !important;
}

/* Preview item — cursor move untuk drag */
.foto-preview-item {
    cursor: move !important;
    position: relative;
}
.foto-preview-item:active {
    cursor: grabbing !important;
}

/* Sortable states */
.foto-sortable-ghost {
    opacity: 0.4;
    background: #fef3c7 !important;
}
.foto-sortable-chosen {
    opacity: 0.9;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Hapus setprimary button (kita pakai drag now, bukan klik) */
.foto-preview-setprimary {
    display: none !important;
}

/* ===================================================================
   PIECE FOTO THUMB di table cell — primary + sortable
=================================================================== */

/* Primary indicator: border kuning + badge ★ */
.piece-foto-thumb-wrap.is-primary {
    border: 2px solid #f59e0b !important;
    box-shadow: 0 0 0 1px rgba(245,158,11,0.3);
}
.piece-thumb-primary-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #f59e0b;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    line-height: 1;
}

/* Hapus pseudo-selector lama (yang force :first-child border) */
.piece-foto-thumb-wrap:first-child {
    border-color: rgb(229 231 235) !important;
    border-width: 1px !important;
}
.piece-foto-thumb-wrap:first-child::after {
    content: none !important;
}
/* Tapi primary class override */
.piece-foto-thumb-wrap.is-primary {
    border-color: #f59e0b !important;
    border-width: 2px !important;
}

/* Cursor + drag affordance */
.piece-foto-thumb-wrap {
    cursor: move;
    transition: transform 0.15s;
    position: relative;
}
.piece-foto-thumb-wrap:hover {
    transform: scale(1.08);
    z-index: 2;
}

/* ===================================================================
   PIECE THUMB delete button (di table cell)
=================================================================== */
.piece-thumb-delete {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgb(220 38 38);
    color: white;
    border: 1.5px solid white;
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 6;
    opacity: 0.85;
    transition: all 0.15s;
}
.piece-thumb-delete:hover {
    opacity: 1;
    background: rgb(185 28 28);
    transform: scale(1.15);
}

/* Adjust badge primary kalau ada delete (offset biar gak overlap) */
.piece-foto-thumb-wrap.is-primary .piece-thumb-primary-badge {
    top: -3px;
    right: 14px; /* geser ke kiri biar gak overlap delete */
}




/* ===== POS � Rapetin gap antar card .pos-section ===== */
.pos-section {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    padding: 0.5rem 0.75rem !important;
}
.pos-section + .pos-section {
    margin-top: 0.125rem !important;
}
.pos-section h3 {
    margin-bottom: 0.5rem !important;
    font-size: 13px !important;
}



/* ===== POS Filament page wrapper � kill gap antar pos-section ===== */
.fi-page .fi-main,
.fi-page .fi-main > div,
.fi-page-content,
.fi-page-content > div,
[class*="fi-page"] > [class*="fi-section-ctn"] {
    gap: 0.125rem !important;
}
/* Direct child container of POS page */
.fi-main > section > div,
.fi-page > section > div {
    gap: 0.125rem !important;
    row-gap: 0.125rem !important;
}
/* Force pos-section super tight */
.pos-section {
    margin: 0 !important;
}
.pos-section + .pos-section {
    margin-top: 0.125rem !important;
}

/* ===== POS & Buyback � force semua section putih (override inline style) ===== */
.pos-section,
.pos-section[style*="background"] {
    background: white !important;
    border-color: #e5e7eb !important;
}

/* ===== FIX: Form actions buttons harus tampil sebagai text button ===== */
.fi-sc-actions .fi-ac button,
.fi-ac.fi-align-start button,
[id*="form-actions"] button {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    min-height: 2.25rem !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
}
.fi-sc-actions .fi-ac button.fi-color-primary,
[id*="form-actions"] button[type="submit"] {
    background-color: rgb(217 119 6) !important;
    color: white !important;
}
.fi-sc-actions .fi-ac button:not(.fi-color-primary):not([type="submit"]),
[id*="form-actions"] button[type="button"] {
    background-color: rgb(243 244 246) !important;
    color: rgb(55 65 81) !important;
}
/* Tampilkan label aria sebagai text kalau button kosong */
[id*="form-actions"] button::after {
    content: attr(aria-label);
}

/* ===== Tab pills Penerimaan Barang (& semua ListRecords tabs) ===== */
.fi-tabs-tab {
    border-radius: 9999px !important;
    padding: 0.35rem 1rem !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    border: 0.5px solid var(--color-border-tertiary) !important;
    margin-right: 4px !important;
    transition: background 0.15s, color 0.15s !important;
}
.fi-tabs-tab:not([aria-selected="true"]) {
    background: transparent !important;
    color: var(--color-text-secondary) !important;
}
.fi-tabs-tab[aria-selected="true"] {
    background: #BA7517 !important;
    color: #fff !important;
    border-color: #BA7517 !important;
}
.fi-tabs-tab[aria-selected="true"] .fi-badge {
    background: rgba(255,255,255,0.25) !important;
    color: #fff !important;
}
.fi-tabs-tab:not([aria-selected="true"]) .fi-badge {
    background: var(--color-background-tertiary) !important;
    color: var(--color-text-secondary) !important;
}
.fi-tabs-list {
    border-bottom: none !important;
    gap: 4px !important;
    padding-bottom: 0.75rem !important;
}

/* ===== Hamburger sidebar toggle ===== */

/* ===== Topbar tidak fixed - ikut scroll halaman ===== */
.fi-topbar {
    position: relative !important;
    top: auto !important;
}
.fi-topbar nav {
    position: relative !important;
}


/* ===== Detail Per Piece — UX Improvements ===== */

/* Header info nota lebih compact */
.fi-page .fi-form > div:first-child {
    background: var(--color-background-primary) !important;
}

/* Repeater pieces — baris lebih compact */
.fi-fo-repeater-item {
    border: 0.5px solid var(--color-border-tertiary) !important;
    border-radius: var(--border-radius-md) !important;
    padding: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

/* TableRepeater header */
.fi-fo-table-repeater thead tr th {
    background: var(--color-background-secondary) !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: var(--color-text-secondary) !important;
    padding: 6px 8px !important;
    border-bottom: 0.5px solid var(--color-border-tertiary) !important;
}

/* TableRepeater rows */
.fi-fo-table-repeater tbody tr td {
    padding: 6px 8px !important;
    vertical-align: middle !important;
    border-bottom: 0.5px solid var(--color-border-tertiary) !important;
}

/* TableRepeater alternating rows */
.fi-fo-table-repeater tbody tr:nth-child(even) {
    background: var(--color-background-secondary) !important;
}

/* Input fields di dalam repeater lebih kecil */
.fi-fo-table-repeater .fi-input {
    font-size: 12px !important;
    padding: 4px 8px !important;
    min-height: 32px !important;
}

/* Select di dalam repeater */
.fi-fo-table-repeater .fi-select-input {
    font-size: 12px !important;
    min-height: 32px !important;
}

/* Koef jual helper text warna info */
.fi-fo-field-wrp:has(input[id*="koef_jual"]) .fi-fo-field-wrp-helper-text {
    color: var(--color-text-info) !important;
    font-size: 11px !important;
}

/* Progress summary placeholder */
.fi-fo-placeholder {
    font-size: 12px !important;
    padding: 6px 0 !important;
}

/* ===== Detail Per Piece — Fix CSS dengan class v4 yang benar ===== */

/* Input lebih compact di dalam repeater */
.fi-fo-repeater-item .fi-input {
    font-size: 12px !important;
    padding: 4px 8px !important;
    min-height: 30px !important;
}

/* Select lebih compact */
.fi-fo-repeater-item .fi-select-input {
    font-size: 12px !important;
    min-height: 30px !important;
}

/* Label field lebih kecil */
.fi-fo-repeater-item .fi-fo-field-label {
    font-size: 11px !important;
}

/* Helper text koef jual */
.fi-fo-repeater-item .fi-fo-field-wrp-helper-text {
    font-size: 11px !important;
    color: var(--color-text-info) !important;
}

/* Pieces nested repeater — lebih compact */
.fi-fo-repeater-item .fi-fo-repeater-item {
    border: 0.5px solid var(--color-border-tertiary) !important;
    border-radius: var(--border-radius-md) !important;
    padding: 0.4rem 0.6rem !important;
    margin-bottom: 0.35rem !important;
    background: var(--color-background-primary) !important;
}

/* Pieces nested repeater alternating */
.fi-fo-repeater-item .fi-fo-repeater-item:nth-child(even) {
    background: var(--color-background-secondary) !important;
}

/* Sembunyikan label di dalam pieces (sudah ada TableColumn header) */
.fi-fo-repeater-item .fi-fo-repeater-item .fi-fo-field-label-col {
    display: none !important;
}

/* Placeholder berat summary lebih kecil */
.fi-fo-repeater-item .fi-fo-placeholder-content {
    font-size: 12px !important;
}

/* Outer repeater item (per nota item) styling */
.fi-fo-repeater-items > .fi-fo-repeater-item {
    border: 1px solid var(--color-border-secondary) !important;
    border-radius: var(--border-radius-lg) !important;
    overflow: hidden !important;
}

/* Header item repeater */
.fi-fo-repeater-item > .fi-fo-repeater-item-header {
    background: var(--color-background-secondary) !important;
    padding: 0.6rem 1rem !important;
    border-bottom: 0.5px solid var(--color-border-tertiary) !important;
}

.fi-fo-repeater-item-header-label {
    font-size: 13px !important;
    font-weight: 500 !important;
}

/* ===== Detail Per Piece FINAL — high specificity ===== */
.fi-page .fi-fo-repeater-items > .fi-fo-repeater-item {
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    margin-bottom: 0.75rem !important;
}
.fi-page .fi-fo-repeater-item > .fi-fo-repeater-item-header {
    background: #f3f4f6 !important;
    padding: 0.6rem 1rem !important;
    border-bottom: 1px solid #e5e7eb !important;
}
.fi-page .fi-fo-repeater-item-header-label {
    font-size: 13px !important;
    font-weight: 500 !important;
}
.fi-page .fi-fo-repeater-item-content {
    padding: 0.75rem !important;
}
.fi-page .fi-fo-repeater-item .fi-fo-repeater-item {
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    padding: 0.5rem 0.75rem !important;
    margin-bottom: 0.375rem !important;
}
.fi-page .fi-fo-repeater-item .fi-fo-repeater-item:nth-child(odd) {
    background: #ffffff !important;
}
.fi-page .fi-fo-repeater-item .fi-fo-repeater-item:nth-child(even) {
    background: #f9fafb !important;
}

/* Checkbox Retur rata tengah di table repeater */
[wire\:model*="is_retur"],
[id*="is_retur"] {
    margin: 0 auto !important;
    display: block !important;
}
[wire\:model*="is_retur"]~*,
[id*="is_retur"]~* {
    text-align: center !important;
}
.fi-fo-checkbox-wrp {
    justify-content: center !important;
    display: flex !important;
}

/* Fix checkbox retur center - target fi-fo-field-label */
.fi-fo-field-label:has(input[id*="is_retur"]) {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
}
input[id*="is_retur"] {
    margin: 0 auto !important;
}
