/*
 * EKS QTApp theme: พรีเมียม เรียบง่าย โทนขาว + เขียวอ่อน (ไม่มีพื้นสีดำ)
 * โหลดหลัง CSS ของ Filament ผ่าน render hook ใน AdminPanelProvider
 */
:root {
    --qt-bg: #f4f9f6;
    --qt-surface: #ffffff;
    --qt-border: #e3efe8;
    --qt-mint: #e8f6ee;
    --qt-mint-strong: #d3eedf;
    --qt-text: #24372e;
    --qt-muted: #6b7f75;
    --qt-shadow: 0 1px 2px rgba(36, 80, 58, .04), 0 4px 16px rgba(36, 80, 58, .05);
}

/* พื้นหลังทั้งหน้า และสีตัวอักษรหลัก (เทาเขียวเข้ม แทนสีดำ) */
.fi-body {
    background-color: var(--qt-bg);
    color: var(--qt-text);
}

/* แถบด้านบน */
.fi-topbar > nav,
.fi-topbar {
    background-color: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    box-shadow: none;
    border-bottom: 1px solid var(--qt-border);
}

/* แถบเมนูด้านข้าง */
.fi-sidebar,
.fi-sidebar-header {
    background-color: var(--qt-surface);
}
.fi-sidebar {
    border-inline-end: 1px solid var(--qt-border);
}
.fi-sidebar-item.fi-active > a,
.fi-sidebar-item.fi-active > button {
    background-color: var(--qt-mint);
}
.fi-sidebar-item > a:hover,
.fi-sidebar-item > button:hover {
    background-color: var(--qt-mint);
}

/* การ์ด / ตาราง / กล่องข้อมูล: ขาว มุมโค้ง เงาบาง */
.fi-section,
.fi-ta-ctn,
.fi-wi-stats-overview-stat {
    background-color: var(--qt-surface);
    border-radius: 14px;
    box-shadow: var(--qt-shadow);
    --tw-ring-color: var(--qt-border);
}

/* หัวตาราง */
.fi-ta-header-cell {
    background-color: #f7fbf9;
    color: var(--qt-muted);
}

/* หน้า Login / หน้าเดี่ยว: พื้นไล่สีเขียวอ่อน การ์ดขาว */
.fi-simple-layout {
    background: radial-gradient(1200px 600px at 10% -10%, var(--qt-mint-strong), transparent 60%),
                radial-gradient(900px 500px at 110% 110%, var(--qt-mint), transparent 60%),
                var(--qt-bg);
}
.fi-simple-main {
    background-color: var(--qt-surface);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(36, 80, 58, .10);
    --tw-ring-color: var(--qt-border);
}

/* ===== ตัวแก้ไขรายการใบเสนอราคา (resources/views/filament/forms/quotation-lines.blade.php) ===== */
.qt-lines { --qt-green: #2fa56f; --qt-green-dark: #1f7a50; font-size: .9rem; }
.qt-input {
    width: 100%; border: 1px solid #d5e5dc; border-radius: 6px; padding: 6px 8px;
    background: #fff; color: var(--qt-text); font: inherit; outline: none;
}
.qt-input:focus { border-color: var(--qt-green); box-shadow: 0 0 0 3px rgba(47, 165, 111, .15); }
.qt-num { text-align: right; }
.qt-muted { color: var(--qt-muted); }
.qt-select-sm { width: auto; padding: 4px 8px; margin-left: 6px; }
.qt-lines-toolbar { display: flex; justify-content: flex-end; margin-bottom: 8px; color: var(--qt-muted); }

.qt-lines-table { overflow-x: auto; border-radius: 10px; }
.qt-lines-head, .qt-line-main {
    display: grid;
    grid-template-columns: 20px 34px minmax(260px, 1fr) 76px 76px 110px 86px 110px 92px;
    gap: 6px; align-items: start; min-width: 900px;
}
.qt-lines-head {
    background: #e8f6ee; color: #1f5e40; font-weight: 600; padding: 10px 8px; border-radius: 10px 10px 0 0;
}
.qt-lines-head .qt-c-qty, .qt-lines-head .qt-c-price, .qt-lines-head .qt-c-disc, .qt-lines-head .qt-c-amount { text-align: right; }
.qt-line { border-bottom: 1px solid var(--qt-border); padding: 10px 8px; background: #fff; min-width: 900px; }
.qt-line:hover { background: #fafdfb; }
.qt-line.is-heading { background: #f4f9f6; }
.qt-line.is-heading .qt-name { font-weight: 600; color: #1f5e40; }
.qt-line.is-note .qt-name { font-style: italic; }
.qt-line.is-drag-over { box-shadow: inset 0 3px 0 var(--qt-green); }
.qt-c-no { text-align: center; padding-top: 7px; color: var(--qt-muted); }
.qt-c-amount { text-align: right; padding-top: 7px; font-weight: 600; }
.qt-c-spacer { grid-column: span 5; }
.qt-c-desc .qt-details {
    margin-top: 4px; resize: vertical; min-height: 34px; field-sizing: content; color: #4b6157; line-height: 1.5;
}
.qt-handle { cursor: grab; color: #9fb5aa; display: inline-block; padding-top: 6px; user-select: none; font-size: 1.05rem; }
.qt-handle:active { cursor: grabbing; }
.qt-c-actions { display: flex; gap: 2px; align-items: center; justify-content: flex-end; padding-top: 2px; }
.qt-icon-btn { border: 0; background: transparent; color: #8aa397; padding: 3px 4px; border-radius: 6px; cursor: pointer; font-size: .85rem; }
.qt-icon-btn:hover { background: var(--qt-mint); color: var(--qt-green-dark); }
.qt-icon-btn.qt-danger:hover { background: #fdecea; color: #c0392b; }

.qt-line-cost {
    display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 6px 0 0 66px;
    font-size: .8rem; color: var(--qt-muted);
}
.qt-line-cost label { display: inline-flex; gap: 6px; align-items: center; }
.qt-cost { width: 110px; padding: 3px 6px; }
.qt-cost-label { color: #b07d1a; }
.qt-wht { display: inline-flex; gap: 4px; align-items: center; }
.qt-wht .qt-select-sm { margin-left: 0; padding: 3px 6px; font-size: .8rem; }
.qt-summary-cost-title { font-weight: 600; color: #b07d1a; margin-bottom: 2px; }
.qt-summary-cost .qt-cost { display: inline-block; margin-left: 6px; }
.qt-check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.qt-check input { accent-color: var(--qt-green); width: 16px; height: 16px; }
.qt-line-profit b { color: var(--qt-green-dark); }
.is-loss, .qt-line-profit.is-loss b { color: #c0392b !important; }

.qt-lines-add { display: flex; gap: 12px; align-items: center; margin: 14px 0; }
.qt-btn-outline {
    border: 1px solid var(--qt-green); color: var(--qt-green-dark); background: #fff;
    padding: 7px 16px; border-radius: 8px; cursor: pointer; font-weight: 500;
}
.qt-btn-outline:hover { background: var(--qt-mint); }
.qt-btn-link { border: 0; background: none; color: var(--qt-muted); cursor: pointer; }
.qt-btn-link:hover { color: var(--qt-green-dark); }

.qt-summary { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-top: 8px; }
.qt-summary-cost {
    background: #fffaf0; border: 1px dashed #ecd9b0; border-radius: 10px; padding: 12px 16px;
    color: #7a6a45; font-size: .85rem; line-height: 1.9; align-self: flex-start;
}
.qt-summary-table { min-width: 380px; border-collapse: collapse; }
.qt-summary-table td { padding: 6px 0; color: var(--qt-green-dark); }
.qt-summary-table td:last-child { text-align: right; color: var(--qt-text); min-width: 140px; }
.qt-summary-table .qt-pct { width: 72px; display: inline-block; margin: 0 4px; padding: 3px 6px; }
.qt-summary-table .qt-disc-amt { width: 140px; padding: 3px 6px; }
.qt-summary-table .qt-grand td { font-weight: 700; font-size: 1.05rem; border-top: 1px solid var(--qt-border); padding-top: 10px; }

/* ยอดรวมตัวใหญ่มุมขวาบน */
.qt-header-total { text-align: right; }
.qt-header-total-label { color: var(--qt-muted); font-weight: 500; }
.qt-header-total-value { font-size: 2.2rem; font-weight: 600; color: #2fa56f; letter-spacing: -.01em; line-height: 1.2; }

/* กล่องข้อมูลลูกค้าใต้ช่องเลือกลูกค้า */
.qt-contact-card { color: var(--qt-muted); line-height: 1.7; font-size: .9rem; }
.qt-contact-card b { color: var(--qt-text); }

/* หัวข้อหน้า */
.fi-header-heading {
    color: var(--qt-text);
    letter-spacing: -.01em;
}
