/* ── Package Master Styles ── */
.pkg-page { display: flex; flex-direction: column; height: 100%; gap: 0; }
.pkg-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; background: #fff; border-bottom: 1px solid #e2e8f0; flex-shrink: 0; }
.pkg-title { display: flex; align-items: center; gap: 14px; }
.pkg-title-icon { width: 42px; height: 42px; border-radius: 10px; background: linear-gradient(135deg, #4f46e5, #6d28d9); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(79,70,229,0.25); }
.pkg-title-icon span { color: #fff; font-size: 20px; }
.pkg-title h2 { margin: 0; font-size: 18px; font-weight: 800; color: #1e293b; }
.pkg-title p { margin: 0; font-size: 12px; color: #64748b; }
.pkg-controls { display: flex; align-items: center; gap: 10px; }
.pkg-search-wrap { position: relative; }
.pkg-search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.pkg-search { border: 1px solid #e2e8f0; border-radius: 20px; padding: 7px 14px 7px 34px; font-size: 13px; color: #1e293b; outline: none; width: 220px; background: #f8fafc; transition: border-color .2s; }
.pkg-search:focus { border-color: #4f46e5; background: #fff; }
.pkg-btn-add { background: linear-gradient(135deg,#4f46e5,#6d28d9); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 6px; box-shadow: 0 3px 10px rgba(79,70,229,0.3); transition: transform .15s,box-shadow .15s; }
.pkg-btn-add:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(79,70,229,0.4); }

/* table */
.pkg-table-wrap { flex: 1; overflow-y: auto; background: #fff; }
.pkg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pkg-table thead th { background: #f8fafc; padding: 10px 14px; font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid #e2e8f0; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.pkg-table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background .15s; }
.pkg-table tbody tr:hover { background: #f8fafc; }
.pkg-table td { padding: 10px 14px; vertical-align: middle; }
.pkg-code { font-family: monospace; font-size: 11px; font-weight: 700; color: #4f46e5; background: #eef2ff; border-radius: 4px; padding: 2px 7px; }
.pkg-name { font-weight: 700; color: #1e293b; }
.pkg-short { font-family: monospace; color: #6d28d9; font-weight: 700; }
.pkg-amount { font-weight: 700; color: #047857; }
.pkg-tests-pill { display: inline-flex; align-items: center; gap: 4px; background: #e0e7ff; color: #3730a3; border-radius: 20px; padding: 2px 10px; font-size: 11px; font-weight: 700; }
.pkg-action-btn { width: 30px; height: 30px; border-radius: 6px; border: 1px solid #e2e8f0; background: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #64748b; transition: all .15s; margin: 0 2px; }
.pkg-action-btn:hover { background: #f1f5f9; border-color: #cbd5e1; color: #1e293b; }
.pkg-action-btn.del:hover { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }
.pkg-empty { text-align: center; padding: 48px; color: #94a3b8; font-size: 14px; }
.pkg-filter-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; font-size: 12px; color: #64748b; }

/* modal */
.pkg-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.pkg-modal { background: #fff; border-radius: 16px; width: 100%; max-width: 1000px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 24px 80px rgba(0,0,0,.25); animation: pkgIn .22s ease; }
@keyframes pkgIn { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
.pkg-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; background: linear-gradient(135deg,#eef2ff,#e0e7ff); border-radius: 16px 16px 0 0; border-bottom: 1px solid #c7d2fe; }
.pkg-modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; color: #3730a3; display: flex; align-items: center; gap: 8px; }
.pkg-modal-close { background: none; border: none; cursor: pointer; color: #6366f1; display: flex; align-items: center; padding: 4px; border-radius: 6px; transition: background .15s; }
.pkg-modal-close:hover { background: #c7d2fe; }
.pkg-modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.pkg-modal-foot { padding: 14px 24px; border-top: 1px solid #e2e8f0; background: #f8fafc; border-radius: 0 0 16px 16px; display: flex; justify-content: space-between; align-items: center; }

/* form fields */
.pkg-form-grid { display: grid; gap: 14px; }
.pkg-form-grid.cols-4 { grid-template-columns: 100px 1fr 2fr 160px; }
.pkg-form-grid.cols-4b { grid-template-columns: 1fr 150px 140px 140px; }
.pkg-label { font-size: 11px; font-weight: 700; color: #475569; margin-bottom: 4px; display: block; text-transform: uppercase; letter-spacing: .04em; }
.pkg-label .req { color: #ef4444; margin-left: 2px; }
.pkg-input { width: 100%; padding: 8px 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 13px; color: #1e293b; background: #f8fafc; outline: none; box-sizing: border-box; transition: border-color .2s,background .2s; }
.pkg-input:focus { border-color: #4f46e5; background: #fff; }
.pkg-input.accent { font-weight: 700; color: #047857; }

/* test picker */
.pkg-picker-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.pkg-picker-title { font-size: 13px; font-weight: 700; color: #1e293b; }
.pkg-picker-controls { display: flex; gap: 6px; align-items: center; position: relative; }
.pkg-combobox-wrap { position: relative; width: 340px; }
.pkg-combobox-input { width: 100%; height: 32px; padding: 0 46px 0 32px; font-size: 12px; background: #fff; border: 1.5px solid #cbd5e1; border-radius: 6px; outline: none; color: #1e293b; transition: border-color .15s, box-shadow .15s; box-sizing: border-box; }
.pkg-combobox-input:focus { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,0.12); }
.pkg-combobox-icon-search { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 16px; color: #94a3b8; pointer-events: none; }
.pkg-combobox-icon-arrow { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 18px; color: #94a3b8; pointer-events: none; transition: transform .2s ease; }
.pkg-combobox-icon-arrow.open { transform: translateY(-50%) rotate(180deg); }
.pkg-combobox-clear { position: absolute; right: 26px; top: 50%; transform: translateY(-50%); border: none; background: transparent; padding: 0; cursor: pointer; color: #94a3b8; display: flex; align-items: center; justify-content: center; }
.pkg-combobox-clear:hover { color: #475569; }
.pkg-combobox-dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1050; max-height: 220px; overflow-y: auto; background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15), 0 8px 10px -6px rgba(0,0,0,0.1); padding: 4px 0; }
.pkg-combobox-item { padding: 8px 10px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #f8fafc; transition: background .12s; }
.pkg-combobox-item:last-child { border-bottom: none; }
.pkg-combobox-item:hover, .pkg-combobox-item.active { background: #eef2ff; }
.pkg-picker-search { padding: 6px 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 12px; width: 200px; outline: none; }
.pkg-picker-search:focus { border-color: #4f46e5; }
.pkg-picker-select { padding: 6px 10px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 12px; width: 240px; height: 34px; outline: none; }
.pkg-picker-select:focus { border-color: #4f46e5; }
.pkg-btn-add-test { background: #4f46e5; color: #fff; border: none; border-radius: 6px; padding: 0 14px; font-size: 12px; font-weight: 700; cursor: pointer; transition: background .15s; height: 32px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pkg-btn-add-test:hover { background: #3730a3; }
.pkg-tests-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pkg-tests-table thead th { background: #f1f5f9; padding: 7px 12px; font-weight: 700; color: #475569; text-align: left; border-bottom: 1px solid #cbd5e1; }
.pkg-tests-table tbody tr { border-bottom: 1px solid #f1f5f9; }
.pkg-tests-table tbody tr:hover { background: #fafafa; }
.pkg-tests-table td { padding: 6px 12px; vertical-align: middle; }
.pkg-test-remove { background: #fee2e2; color: #dc2626; border: none; border-radius: 5px; padding: 3px 9px; font-size: 11px; font-weight: 700; cursor: pointer; }
.pkg-test-remove:hover { background: #fecaca; }
.pkg-summary-bar { display: flex; gap: 20px; padding: 8px 12px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; margin-top: 10px; font-size: 12px; }
.pkg-summary-bar span { color: #064e3b; font-weight: 600; }
.pkg-summary-bar strong { color: #047857; }

/* action buttons in footer */
.pkg-btn-cancel { border: 1.5px solid #e2e8f0; background: #fff; color: #475569; border-radius: 8px; padding: 8px 18px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; }
.pkg-btn-cancel:hover { background: #f8fafc; border-color: #cbd5e1; }
.pkg-btn-save { background: linear-gradient(135deg,#4f46e5,#6d28d9); color: #fff; border: none; border-radius: 8px; padding: 8px 22px; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: 0 3px 10px rgba(79,70,229,.3); transition: all .15s; }
.pkg-btn-save:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(79,70,229,.4); }
.pkg-btn-delete { background: #fef2f2; color: #dc2626; border: 1.5px solid #fca5a5; border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 700; cursor: pointer; transition: all .15s; }
.pkg-btn-delete:hover { background: #fee2e2; }
.pkg-btn-delete:disabled { opacity: .4; cursor: not-allowed; }

/* fee-override section */
.fee-section { margin-top: 8px; padding: 10px 12px; background: #fafafa; border: 1px solid #e2e8f0; border-radius: 8px; }
.fee-section-title { font-size: 11px; font-weight: 700; color: #475569; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .04em; }
.fee-row { display: grid; grid-template-columns: 1fr 120px 110px; gap: 8px; align-items: center; margin-bottom: 6px; }
.fee-row .fee-label { font-size: 12px; color: #1e293b; font-weight: 600; }
