/* ========================================
   Add Stone Page - Dark Theme
   Override style.css เพื่อให้เป็น Dark Theme เฉพาะหน้านี้
   ======================================== */

/* ── Dark Theme Variables ── */
:root {
    --ds-primary: #6c5ce7;
    --ds-primary-light: #a29bfe;
    --ds-success: #00b894;
    --ds-danger: #d63031;
    --ds-warning: #fdcb6e;
    --ds-info: #74b9ff;
    --ds-bg-dark: #1e1e2e;
    --ds-bg-card: #2a2a3e;
    --ds-bg-input: #1a1a2e;
    --ds-text-light: #dfe6e9;
    --ds-text-muted: #b2bec3;
    --ds-border: #3d3d5c;
}

/* ── Override body ── */
body {
    background: var(--ds-bg-dark) !important;
    color: var(--ds-text-light) !important;
}

/* ── Navbar: ปรับให้เข้ากับ dark theme ── */
.navbar {
    background: linear-gradient(135deg, #2a2a3e 0%, #35355a 100%) !important;
    border-bottom: 1px solid var(--ds-border);
}

/* ── Page Header ── */
.page-header-custom {
    background: linear-gradient(135deg, var(--ds-bg-card), #35355a);
    color: var(--ds-text-light);
    padding: 1.25rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--ds-border);
}
.page-header-custom h4 {
    color: #fff;
    margin-bottom: 0;
    font-weight: 700;
}
.page-header-custom .text-muted,
.page-header-custom small {
    color: rgba(223, 230, 233, 0.75) !important;
}
.page-header-custom .btn-light {
    background: rgba(255,255,255,0.1);
    color: var(--ds-text-light);
    border: 1px solid var(--ds-border);
}
.page-header-custom .btn-light:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* ── Form Card & Sidebar Card ── */
.form-card,
.sidebar-card {
    background: var(--ds-bg-card) !important;
    border: 1px solid var(--ds-border) !important;
    color: var(--ds-text-light);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.sidebar-card h6 {
    color: var(--ds-text-light);
}

/* ── Form Controls ── */
.form-control,
.form-select {
    background: var(--ds-bg-input) !important;
    border: 1px solid var(--ds-border) !important;
    color: var(--ds-text-light) !important;
    border-radius: 8px;
}
.form-control:focus,
.form-select:focus {
    background: var(--ds-bg-input) !important;
    border-color: var(--ds-primary-light) !important;
    color: var(--ds-text-light) !important;
    box-shadow: 0 0 0 0.2rem rgba(108,92,231,0.25) !important;
}
.form-control::placeholder,
.form-select::placeholder {
    color: #636e72 !important;
}

/* ── Labels & Hints ── */
.field-label {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    color: var(--ds-text-muted);
}
.field-label .required {
    color: var(--ds-danger);
}
.field-hint {
    font-size: 0.85rem;
    color: #636e72;
    margin-top: 0.25rem;
}

/* ── Buttons ── */
.btn-primary {
    background: linear-gradient(135deg, var(--ds-primary), #f94bf1) !important;
    border: none !important;
    color: #fff !important;
    border-radius: 8px;
    font-weight: 900;
    transition: all 0.2s;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #5a4bd1, var(--ds-primary)) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108,92,231,0.3);
}

.btn-outline-primary,
.btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--ds-border);
    color: var(--ds-text-muted);
    border-radius: 8px;
    transition: all 0.2s;
}
.btn-outline-primary:hover,
.btn-outline-secondary:hover {
    border-color: var(--ds-primary-light);
    color: var(--ds-primary-light);
    background: rgba(108,92,231,0.1);
}

.btn-outline-warning {
    border: 1px solid var(--ds-border);
    color: var(--ds-text-muted);
    background: transparent;
}
.btn-outline-warning:hover:not(:disabled) {
    border-color: var(--ds-warning);
    color: var(--ds-warning);
    background: rgba(253,203,110,0.1);
}
.btn-outline-warning:disabled {
    color: #636e72;
    opacity: 0.6;
}

/* ── Stone Code Input Group ── */
.input-group-code .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.input-group-code .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
}

.next-code-preview {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(0,184,148,0.15);
    border: 1px dashed var(--ds-success);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--ds-success);
    margin-left: 0.5rem;
    font-size: 0.85rem;
}

/* ── Autocomplete Stone Name ── */
.autocomplete-wrapper { position: relative; }
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ds-bg-card);
    border: 1px solid var(--ds-border);
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.autocomplete-list.show { display: block; }

.autocomplete-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(61,61,92,0.5);
    transition: background 0.15s;
    font-size: 0.85rem;
    color: var(--ds-text-light);
}
.autocomplete-item:hover { background: rgba(108,92,231,0.15); }
.autocomplete-item:last-child { border-bottom: none; }

.autocomplete-item.not-found {
    color: var(--ds-warning);
    cursor: default;
    font-style: italic;
    background: rgba(253,203,110,0.05);
}
.autocomplete-item.not-found:hover { background: rgba(253,203,110,0.05); }

.autocomplete-item .stone-meta {
    font-size: 0.85rem;
    color: var(--ds-text-muted);
}

.name-invalid {
    border-color: var(--ds-danger) !important;
    box-shadow: 0 0 0 0.2rem rgba(214,48,49,0.25) !important;
}

/* ── Customer Search ── */
.customer-search-wrapper { position: relative; }
.customer-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ds-bg-card);
    border: 1px solid var(--ds-border);
    border-radius: 0 0 8px 8px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 1040;
    display: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.customer-dropdown.show { display: block; }

.customer-item {
    padding: 0.55rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(61,61,92,0.5);
    transition: background 0.15s;
    font-size: 0.85rem;
    color: var(--ds-text-light);
}
.customer-item:hover { background: rgba(0,184,148,0.15); }
.customer-item:last-child { border-bottom: none; }

.customer-selected-badge {
    display: none;
    background: rgba(0,184,148,0.15);
    border: 1px solid var(--ds-success);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin-top: 0.5rem;
    align-items: center;
    color: var(--ds-text-light);
}
.customer-selected-badge.show { display: flex; }

/* ── Gap Codes Modal ── */
.modal-content {
    background: var(--ds-bg-card) !important;
    border: 1px solid var(--ds-border) !important;
    color: var(--ds-text-light) !important;
    border-radius: 12px;
}
.modal-header {
    border-bottom-color: var(--ds-border) !important;
}
.modal-footer {
    border-top-color: var(--ds-border) !important;
}
.modal-title {
    color: var(--ds-text-light) !important;
}
.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.gap-code-item {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0.3rem;
    background: rgba(108,92,231,0.15);
    border: 1px solid var(--ds-primary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    transition: all 0.2s;
    position: relative;
    color: var(--ds-text-light);
}
.gap-code-item:hover {
    background: var(--ds-primary);
    color: #fff;
    transform: scale(1.05);
}
.gap-code-item.deleted {
    background: rgba(253,203,110,0.15);
    border-color: var(--ds-warning);
    color: var(--ds-warning);
}
.gap-code-item.deleted:hover {
    background: var(--ds-warning);
    color: #000;
}
.gap-code-item .deleted-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--ds-warning);
    color: #000;
    font-size: 0.85rem;
    padding: 1px 5px;
    border-radius: 10px;
    font-weight: 700;
}

.gap-section-title {
    font-size: 0.85rem;
    color: var(--ds-text-muted);
    margin: 1rem 0 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px dashed var(--ds-border);
}

/* ── Sidebar: Latest codes ── */
.latest-code-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(61,61,92,0.4);
    font-size: 0.85rem;
}
.latest-code-item:last-child { border-bottom: none; }

.badge-code {
    font-family: 'Courier New', monospace;
    background: rgba(108,92,231,0.2);
    color: var(--ds-primary-light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ═══════════════════════════════════
   ✨ IMAGE PREVIEW (ใน Sidebar)
   ═══════════════════════════════════ */
.image-preview-sidebar {
    position: relative;
    background: var(--ds-bg-input);
    border: 2px dashed var(--ds-primary);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    display: none;
    min-height: 200px;
}
.image-preview-sidebar.show {
    display: block;
    animation: fadeInPreview 0.3s ease;
}
@keyframes fadeInPreview {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.image-preview-sidebar img {
    max-width: 100%;
    max-height: 280px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    object-fit: contain;
}

.image-preview-sidebar .image-preview-info {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--ds-text-muted);
    text-align: left;
}
.image-preview-sidebar .file-name {
    color: var(--ds-primary-light);
    font-weight: 600;
    word-break: break-all;
    font-size: 0.85rem;
}
.image-preview-sidebar .file-size,
.image-preview-sidebar .file-dimensions {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}
.image-preview-sidebar .file-size {
    background: rgba(108,92,231,0.15);
    color: var(--ds-primary-light);
    margin-right: 0.3rem;
}
.image-preview-sidebar .file-dimensions {
    background: rgba(0,184,148,0.15);
    color: var(--ds-success);
}

.btn-remove-image {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(214,48,49,0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}
.btn-remove-image:hover {
    background: var(--ds-danger);
    transform: scale(1.1);
}

.image-status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.5rem;
}
.image-status-badge.ready {
    background: rgba(0,184,148,0.2);
    color: var(--ds-success);
}
.image-status-badge.warning {
    background: rgba(253,203,110,0.2);
    color: var(--ds-warning);
}

/* Placeholder เมื่อไม่มีรูป */
.image-placeholder {
    padding: 2rem 1rem;
    text-align: center;
    color: #636e72;
    border: 2px dashed var(--ds-border);
    border-radius: 12px;
    background: rgba(26,26,46,0.5);
}
.image-placeholder i {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--ds-primary-light);
    opacity: 0.5;
}
.image-placeholder small {
    display: block;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

/* ── Alert Custom ── */
.alert-custom {
    border-radius: 10px;
    border: none;
    font-size: 0.85rem;
}

/* ── Text colors override ── */
.text-muted {
    color: var(--ds-text-muted) !important;
}
.text-success {
    color: var(--ds-success) !important;
}
.text-danger {
    color: var(--ds-danger) !important;
}
.text-warning {
    color: var(--ds-warning) !important;
}
.text-primary {
    color: var(--ds-primary-light) !important;
}
.text-info {
    color: var(--ds-info) !important;
}

/* ── Scrollbar (dark theme) ── */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--ds-bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--ds-border);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--ds-primary);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .next-code-preview {
        display: block;
        margin-top: 0.5rem;
        margin-left: 0;
    }
    .image-preview-sidebar img {
        max-height: 240px;
    }
}
/* ═══════════════════════════════════
   ✨ CUSTOMER ITEM - แยกชื่อเล่นเด่นชัด
   ═══════════════════════════════════ */
.customer-item {
    padding: 0.6rem 1rem !important;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(61,61,92,0.5);
    transition: all 0.15s;
}
.customer-item:hover {
    background: rgba(0,184,148,0.15);
    padding-left: 1.2rem;
}
.customer-item:last-child { border-bottom: none; }

/* รหัสลูกค้า (badge ซ้าย) */
.customer-item .cust-code {
    display: inline-block;
    min-width: 70px;
    padding: 0.2rem 0.5rem;
    background: rgba(108,92,231,0.2);
    color: var(--ds-primary-light);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    flex-shrink: 0;
}

/* คอนเทนเนอร์ชื่อ (ตรงกลาง) */
.customer-item .cust-names {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

/* ✨ ชื่อเล่น - เด่นชัด ตัวใหญ่ */
.customer-item .cust-nickname {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ds-success);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.customer-item .cust-nickname .nickname-label {
    font-size: 0.85rem;
    color: var(--ds-text-muted);
    font-weight: 500;
    margin-right: 0.3rem;
}

/* ชื่อจริง - ย่อยลง */
.customer-item .cust-fullname {
    display: block;
    font-size: 0.85rem;
    color: var(--ds-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.1rem;
}

/* กรณีไม่มีชื่อเล่น → แสดงชื่อจริงแทน */
.customer-item .cust-nickname.no-nickname {
    color: var(--ds-text-light);
    font-weight: 600;
    font-size: 0.85rem;
}

/* เบอร์โทร (ด้านขวา) */
.customer-item .cust-phone {
    flex-shrink: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--ds-text-muted);
    white-space: nowrap;
}
.customer-item .cust-phone i {
    color: var(--ds-success);
    margin-right: 0.25rem;
    font-size: 0.85rem;
}

/* ปรับ responsive สำหรับจอเล็ก */
@media (max-width: 576px) {
    .customer-item {
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    .customer-item .cust-phone {
        width: 100%;
        font-size: 0.85rem;
    }
}
/* ═══════════════════════════════════
   ✨ HIGHLIGHT MATCH - เน้นตัวอักษรที่ค้นหา
   ═══════════════════════════════════ */
.highlight-match {
    background: linear-gradient(135deg, #fdcb6e, #ffeaa7) !important;
    color: #2d3436 !important;
    padding: 0 3px !important;
    border-radius: 3px !important;
    font-weight: 800 !important;
    box-shadow: 0 0 0 1px rgba(253, 203, 110, 0.8), 0 2px 4px rgba(253, 203, 110, 0.4) !important;
    margin: 0 1px !important;
    display: inline !important;
}

/* Dark theme highlight */
.customer-item .highlight-match {
    background: rgba(253, 203, 110, 0.5) !important;
    color: #fff !important;
    box-shadow: 0 0 0 1px rgba(253, 203, 110, 0.8), 0 0 8px rgba(253, 203, 110, 0.6) !important;
    text-shadow: 0 0 2px rgba(0,0,0,0.3) !important;
}

/* Highlight ในรหัสลูกค้า (monospace) */
.customer-item .cust-code .highlight-match {
    background: rgba(162, 155, 254, 0.6) !important;
    color: #fff !important;
    font-weight: 900 !important;
    box-shadow: 0 0 0 1px rgba(162, 155, 254, 0.8), 0 0 8px rgba(162, 155, 254, 0.6) !important;
}

/* Highlight ในเบอร์โทร */
.customer-item .cust-phone .highlight-match {
    background: rgba(0, 184, 148, 0.5) !important;
    color: #fff !important;
    box-shadow: 0 0 0 1px rgba(0, 184, 148, 0.8), 0 0 8px rgba(0, 184, 148, 0.6) !important;
}

/* First item highlight (รายการแรกที่ตรงที่สุด) */
.customer-item.first-match {
    background: rgba(0, 184, 148, 0.08) !important;
    border-left: 3px solid var(--ds-success) !important;
    padding-left: calc(1rem - 3px) !important;
}
.customer-item.first-match:hover {
    background: rgba(0, 184, 148, 0.15) !important;
}
/* ========================================
   Add Stone Page - 3 Panels Layout
======================================== */

.add-stone-layout {
    align-items: stretch;
}

.layout-panel {
    padding: 1rem;
    border-radius: 12px;
    min-width: 0;
}

.panel-top-left,
.panel-top-right,
.panel-bottom {
    min-width: 0;
}

.panel-top-right {
    display: flex;
    flex-direction: column;
}

.panel-top-right h6 {
    flex: 0 0 auto;
}

.panel-top-right .image-placeholder,
.panel-top-right .image-preview-sidebar {
    flex: 1 1 auto;
}

/* ========================================
   Form Grid - Top Left
======================================== */

.add-form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.85rem 1rem;
    align-items: start;
}

.add-form-grid .form-row-inline {
    display: block;
    margin-bottom: 0;
    min-width: 0;
}

.add-form-grid .field-label-inline {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: none;
    width: auto;
    min-width: 0;
    margin: 0 0 0.4rem 0;
    padding: 0;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: left;
    line-height: 1.35;
}

.add-form-grid .field-control {
    width: 100%;
    min-width: 0;
}

.add-form-grid .field-hint {
    margin-top: 0.35rem;
}

.add-form-grid .hint-inline {
    white-space: normal;
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem;
}

/* Grid positioning */
.cell-code {
    grid-column: span 4;
}

.cell-name {
    grid-column: span 8;
}

.cell-price {
    grid-column: 1 / -1;
}

.cell-image {
    grid-column: span 7;
}

.cell-notes {
    grid-column: span 5;
}

.cell-customer {
    grid-column: 1 / -1;
}

.cell-actions {
    grid-column: 1 / -1;
    margin-top: 0.25rem;
}

/* ========================================
   Field Width Overrides
======================================== */

.cell-code .input-group {
    width: 100%;
    max-width: 320px;
}

.cell-code .form-control {
    width: 100%;
}

.cell-name .autocomplete-wrapper,
.cell-image .file-hint-group,
.cell-customer .customer-search-wrapper,
.cell-notes .form-control {
    width: 100% !important;
    max-width: 100%;
}

.cell-name .input-group {
    width: 100%;
}

.cell-name .form-control {
    width: 100%;
}

/* ========================================
   Size / Price Row
======================================== */

.cell-price .fields-inline-row {
    display: grid;
    grid-template-columns: minmax(120px, 180px) minmax(160px, 230px) minmax(160px, 230px);
    gap: 0.75rem;
    width: 100%;
    align-items: start;
}

.cell-price .field-inline {
    display: block;
    width: 100%;
    min-width: 0;
}

.cell-price .field-inline-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    width: 100%;
    margin: 0 0 0.35rem 0;
    font-size: 0.85rem;
}

.cell-price .form-control {
    width: 100% !important;
}

/* ========================================
   Image File Field
======================================== */

.cell-image .file-hint-group {
    display: flex;
    align-items: stretch;
}

.cell-image .file-hint-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.cell-image .file-hint-group .hint-inline {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
    display: flex;
    align-items: center;
}

.cell-image .image-status-badge {
    margin-top: 0.4rem;
    margin-left: 0;
}

/* ========================================
   Customer Field
======================================== */

.cell-customer .customer-hint-group {
    width: 100%;
}

.cell-customer .customer-hint-group .hint-inline {
    max-width: 320px;
}

/* ========================================
   Latest Codes - Bottom Grid
======================================== */

.latest-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
}

.latest-grid .latest-code-item {
    padding: 0.5rem 0.6rem;
    margin: 0;
    border: 1px solid rgba(61, 61, 92, 0.55);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    min-width: 0;
}

.latest-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
}

.latest-cell .latest-code-link {
    display: inline-block;
}

.latest-cell .badge-code {
    font-size: 0.85rem;
    padding: 0.22rem 0.45rem;
}

.latest-cell .latest-name-link {
    display: block;
    width: 100%;
    text-align: left;
    font-size: 0.85rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.latest-cell .latest-customer-tag {
    display: block;
    font-size: 0.85rem;
}

/* ========================================
   Responsive
======================================== */

@media (max-width: 1199.98px) {
    .cell-code {
        grid-column: span 5;
    }

    .cell-name {
        grid-column: span 7;
    }

    .cell-image,
    .cell-notes {
        grid-column: 1 / -1;
    }

    .latest-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .add-form-grid > * {
        grid-column: 1 / -1 !important;
    }

    .cell-price .fields-inline-row {
        grid-template-columns: 1fr;
    }

    .layout-panel {
        padding: 0.85rem;
    }
}

@media (max-width: 575.98px) {
    .latest-grid {
        grid-template-columns: 1fr;
    }
}
/* ✅ กลุ่มขนาด/ราคา/ทุน/ขาย - บังคับบรรทัดเดียว */
.cell-price .field-control {
flex-wrap: nowrap !important;
gap: 3rem !important;
}
.price-field-group {
display: inline-flex;
align-items: center;
gap: 0.3rem;
flex-wrap: nowrap;
flex-shrink: 0;
}
.price-field-label {
white-space: nowrap;
font-size: 0.85rem;
color: var(--ds-text-muted, #8e8ea0);
margin: 0;
font-weight: 500;
}
.price-field-label .required {
color: var(--ds-danger, #f87171);
}
/* ✅ ปรับความกว้าง input ให้พอดี ไม่ยาวเกินไป */
.cell-price .input-narrow {
width: 70px !important;
min-width: 70px !important;
}
.cell-price .input-price {
width: 95px !important;
min-width: 95px !important;
}
.cell-price .btn-sm {
flex-shrink: 0;
}
/* ✅ Responsive: จอเล็กมากค่อยให้ wrap */
@media (max-width: 575.98px) {
.cell-price .field-control {
flex-wrap: wrap !important;
}
.cell-price .input-price {
width: 100% !important;
}
}
/* ✅ ปรับขนาดตัวอักษรของ checkbox/radio label ให้เท่ากับส่วนอื่น */
.add-form-grid .form-check-label {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--ds-text-light);
    line-height: 1.5;
}

/* ถ้าต้องการให้ตัวหนาเท่ากับ field-label-inline */
.add-form-grid .form-check-label {
    font-weight: 500;
}