* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Prompt', sans-serif; }
body { background-color: #f0f2f5; color: #333333; display: flex; min-height: 100vh; }

/* Toast Notification */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 260px; padding: 12px 18px; border-radius: 8px; color: #fff; font-size: 13.5px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 10px; animation: slideIn 0.3s forwards; }
.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
.toast.info { background: #2563eb; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Confirm Pop-up */
.confirm-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.55); z-index: 10000; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.2s ease-out; }
.confirm-modal-box { background: #ffffff; border-radius: 14px; width: 90%; max-width: 520px; padding: 26px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); text-align: center; }
.confirm-modal-icon { width: 65px; height: 65px; border-radius: 50%; background: #dcfce7; color: #16a34a; display: flex; align-items: center; justify-content: center; font-size: 32px; margin: 0 auto 16px auto; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes highlightPulse {
  0% { border-color: #16a34a; box-shadow: 0 0 14px rgba(22, 163, 74, 0.5); transform: scale(1.008); }
  50% { border-color: #16a34a; box-shadow: 0 0 22px rgba(22, 163, 74, 0.7); }
  100% { border-color: #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,0.04); transform: scale(1); }
}
.highlight-new-created { border: 2px solid #16a34a !important; animation: highlightPulse 2.8s ease-out; position: relative; }
.badge-new-glow { background: #16a34a; color: #fff; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 12px; display: inline-flex; align-items: center; gap: 5px; }

/* Sidebar */
.sidebar { width: 230px; background: #f4f5f7; border-right: 1px solid #e5e7eb; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 100; }
.brand { padding: 16px 20px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid #e5e7eb; }
.brand-logo-text { font-size: 19px; font-weight: 800; font-style: italic; color: #cc0000; letter-spacing: -0.5px; }
.brand-logo-sub { font-size: 10px; letter-spacing: 3px; color: #71717a; display: block; margin-top: -3px; font-style: normal; font-weight: 600; }
.menu { list-style: none; padding: 12px 8px; flex: 1; overflow-y: auto; }
.menu li { margin-bottom: 4px; }
.menu button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: #374151; background: none; border: none; border-radius: 6px; font-size: 13.5px; cursor: pointer; text-align: left; transition: all 0.15s; }
.menu button i { font-size: 15px; width: 20px; color: #4b5563; }
.menu button:hover { background: #e5e7eb; }
.menu button.active { background: #ffffff; font-weight: 600; color: #c91414; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.menu button.active i { color: #c91414; }
.sidebar-collapse-btn { padding: 12px; text-align: right; color: #9ca3af; cursor: pointer; font-size: 14px; }

/* Main Area */
.main-wrapper { margin-left: 230px; flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { background: #ffffff; height: 56px; padding: 0 28px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e5e7eb; }
.topbar-branch { font-size: 14px; color: #374151; font-weight: 500; }
.topbar-center-search { width: 380px; display: flex; align-items: center; background: #ffffff; border: 1px solid #d1d5db; border-radius: 20px; padding: 6px 14px; gap: 8px; font-size: 13px; }
.topbar-center-search input { border: none; outline: none; width: 100%; font-size: 12.5px; color: #374151; }
.topbar-user { display: flex; align-items: center; gap: 14px; font-size: 13px; color: #4b5563; }
.user-avatar-circle { width: 32px; height: 32px; background: #9ca3af; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #ffffff; font-size: 17px; }
.content-area { padding: 22px 28px; flex: 1; }

/* Breadcrumbs & Common Components */
.breadcrumb-bar { font-size: 14px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 6px; }
.breadcrumb-bar a { text-decoration: none; color: #1f2937; cursor: pointer; }
.breadcrumb-bar a:hover { text-decoration: underline; }
.breadcrumb-bar span.active { color: #c91414; }
.page-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.btn-add-product, .btn-add-order { background: #c91414; color: #ffffff; border: none; padding: 7px 18px; border-radius: 20px; font-size: 13.5px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background 0.15s; }
.btn-add-product:hover, .btn-add-order:hover { background: #b01010; }

/* Stock Styles */
.stock-sub-tabs { display: flex; gap: 24px; border-bottom: 1px solid #e5e7eb; margin-bottom: 18px; }
.stock-sub-tab-btn { background: none; border: none; font-size: 14.5px; font-weight: 600; color: #4b5563; padding: 8px 4px 12px 4px; cursor: pointer; position: relative; transition: all 0.15s; }
.stock-sub-tab-btn:hover { color: #111827; }
.stock-sub-tab-btn.active { color: #c91414; }
.stock-sub-tab-btn.active::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 100%; height: 2.5px; background: #c91414; border-radius: 2px 2px 0 0; }
.metric-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.metric-card { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px 20px; display: flex; align-items: center; gap: 16px; box-shadow: 0 1px 2px rgba(0,0,0,0.03); position: relative; transition: all 0.2s ease; }
.metric-card.clickable { cursor: pointer; }
.metric-card.clickable:hover { border-color: #c91414; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(201, 20, 20, 0.12); }
.metric-card.active-filter { border: 2px solid #c91414; background: #fffafa; }
.metric-icon-circle { width: 44px; height: 44px; border-radius: 50%; background: #f1f3f5; display: flex; align-items: center; justify-content: center; color: #374151; font-size: 18px; flex-shrink: 0; }
.metric-icon-circle.danger { background: #c91414; color: #ffffff; }
.metric-info { display: flex; flex-direction: column; }
.metric-title { font-size: 12.5px; color: #6b7280; margin-bottom: 2px; }
.metric-value { font-size: 17px; font-weight: 700; color: #111827; }
.click-hint-pill { margin-left: auto; font-size: 11px; background: #fee2e2; color: #c91414; padding: 3px 8px; border-radius: 12px; font-weight: 500; display: flex; align-items: center; gap: 4px; }
.filter-active-banner { background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; padding: 10px 16px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; color: #991b1b; }
.btn-clear-filter { background: #ffffff; border: 1px solid #dc2626; color: #dc2626; padding: 3px 12px; border-radius: 14px; font-size: 12px; font-weight: 600; cursor: pointer; }
.btn-clear-filter:hover { background: #dc2626; color: #ffffff; }

/* Table Styles */
.card-container { background: #ffffff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); overflow: hidden; border: 1px solid #e5e7eb; margin-bottom: 26px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { background: #6c757d; color: #ffffff; font-weight: 500; padding: 11px 16px; text-align: left; font-size: 13px; user-select: none; }
thead th.sortable { cursor: pointer; }
thead th.sortable:hover { background: #5a6268; }
thead th .sort-icon { font-size: 11px; opacity: 0.7; margin-left: 4px; }
tbody td { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; color: #374151; vertical-align: middle; }
tbody tr:hover { background-color: #fafafa; }
.badge-id { font-weight: 600; color: #1f2937; display: inline-block; min-width: 24px; }
.badge-low-alert { display: inline-flex; align-items: center; gap: 4px; background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 600; margin-left: 6px; }
.badge-size { background: #f1f5f9; border: 1px solid #cbd5e1; color: #334155; padding: 2px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 600; }
.action-group { display: flex; align-items: center; gap: 6px; }
.btn-delete-pill { background: #ffffff; color: #c91414; border: 1px solid #c91414; padding: 3px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.btn-delete-pill:hover { background: #fee2e2; }
.btn-edit-pill { background: #c91414; color: #ffffff; border: 1px solid #c91414; padding: 3px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.btn-edit-pill:hover { background: #a80f0f; }

/* Product Form */
.form-section-title { font-size: 13.5px; font-weight: 600; color: #1f2937; margin-bottom: 8px; }
.form-section-title span.req { color: #c91414; margin-left: 2px; }
.text-input-field { width: 100%; max-width: 360px; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13.5px; outline: none; }
.text-input-field:focus { border-color: #c91414; }
.radio-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 240px)); gap: 12px; margin-bottom: 18px; }
.radio-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 18px; }
.radio-grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 18px; }
.radio-card { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px; background: #ffffff; cursor: pointer; user-select: none; transition: all 0.15s ease; min-height: 44px; }
.radio-card input[type="radio"] { display: none; }
.radio-card .text-group { display: flex; flex-direction: column; }
.radio-card .main-text { font-size: 12.5px; font-weight: 500; color: #1f2937; }
.radio-card .sub-text { font-size: 10px; color: #6b7280; }
.radio-card .indicator { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid #9ca3af; display: flex; align-items: center; justify-content: center; font-size: 9px; flex-shrink: 0; }
.radio-card:has(input[type="radio"]:checked) { background: #c91414 !important; border-color: #c91414 !important; }
.radio-card:has(input[type="radio"]:checked) .main-text { color: #ffffff !important; font-weight: 600; }
.radio-card:has(input[type="radio"]:checked) .sub-text { color: rgba(255, 255, 255, 0.85) !important; }
.radio-card:has(input[type="radio"]:checked) .indicator { border-color: #ffffff; background: #ffffff; color: #c91414; }
.radio-card:has(input[type="radio"]:checked) .indicator::after { content: "✔"; font-weight: 900; }
.input-unit-wrapper { display: flex; max-width: 360px; }
.input-unit-wrapper input { flex: 1; padding: 8px 12px; border: 1px solid #d1d5db; border-right: none; border-top-left-radius: 6px; border-bottom-left-radius: 6px; font-size: 13.5px; outline: none; }
.input-unit-wrapper input:focus { border-color: #c91414; }
.input-unit-wrapper .unit-badge { background: #6c757d; color: #ffffff; padding: 8px 18px; font-size: 13px; border-top-right-radius: 6px; border-bottom-right-radius: 6px; display: flex; align-items: center; justify-content: center; }
.form-actions-bar { margin-top: 24px; padding-top: 16px; border-top: 1px solid #f3f4f6; display: flex; gap: 10px; }

/* Order Styles */
.order-filter-card { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 20px 24px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.order-filter-row { display: flex; align-items: center; margin-bottom: 14px; font-size: 13.5px; }
.order-filter-label { width: 150px; font-weight: 600; color: #374151; flex-shrink: 0; }
.order-radio-group { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.order-radio-label { display: flex; align-items: center; gap: 7px; cursor: pointer; color: #4b5563; user-select: none; }
.order-radio-label input[type="radio"] { width: 17px; height: 17px; accent-color: #c91414; cursor: pointer; }
.order-search-bottom-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-top: 6px; }
.order-input-date, .order-input-code { border: 1px solid #d1d5db; border-radius: 6px; padding: 6px 12px; font-size: 13.5px; outline: none; color: #374151; }
.order-input-date:focus, .order-input-code:focus { border-color: #c91414; }
.order-btn-clear { background: #ffffff; border: 1px solid #d1d5db; color: #4b5563; padding: 6px 20px; border-radius: 6px; font-size: 13.5px; cursor: pointer; }
.order-btn-clear:hover { background: #f3f4f6; }
.order-btn-search { background: #c91414; border: 1px solid #c91414; color: #ffffff; padding: 6px 22px; border-radius: 6px; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.order-btn-search:hover { background: #a80f0f; }

.order-display-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 20px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); transition: all 0.3s; }
.order-card-header { background: #edf0f5; padding: 16px 22px; border-bottom: 1px solid #e2e8f0; }
.order-card-header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.order-card-title-group { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: #1e293b; }
.order-gear-badge { background: #eab308; color: #ffffff; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.order-card-code { font-size: 14px; font-weight: 600; color: #475569; }
.order-card-header-mid { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #334155; }
.badge-status-yellow { background: #eab308; color: #ffffff; padding: 2px 10px; border-radius: 12px; font-weight: 600; font-size: 12px; display: inline-block; margin-right: 8px; }
.badge-status-green { background: #10b981; color: #ffffff; padding: 2px 10px; border-radius: 12px; font-weight: 600; font-size: 12px; display: inline-block; margin-right: 8px; }
.badge-status-gray { background: #64748b; color: #ffffff; padding: 2px 10px; border-radius: 12px; font-weight: 600; font-size: 12px; display: inline-block; margin-right: 8px; }
.badge-status-red { background: #ef4444; color: #ffffff; padding: 2px 10px; border-radius: 12px; font-weight: 600; font-size: 12px; display: inline-block; margin-right: 8px; }
.pill-status-red-outline { background: #ffffff; border: 1px solid #ef4444; color: #ef4444; border-radius: 14px; padding: 3px 12px; font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; }
.pill-status-green-outline { background: #ffffff; border: 1px solid #10b981; color: #10b981; border-radius: 14px; padding: 3px 12px; font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; }
.order-card-creator { font-size: 12px; color: #64748b; margin-top: 6px; }
.order-card-body { padding: 20px 24px; }
.order-section-group { margin-bottom: 18px; }
.order-section-group:last-child { margin-bottom: 0; }
.order-section-title { font-size: 13.5px; font-weight: 600; color: #1e293b; margin-bottom: 10px; }
.order-item-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.order-item-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; min-width: 260px; font-size: 13px; color: #334155; }

/* Order Card Footer & Buttons */
.order-card-footer { padding: 14px 22px; border-top: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; background: #ffffff; }
.btn-card-gray { background: #5c6773; color: #ffffff; border: none; padding: 7px 16px; border-radius: 6px; font-size: 12.5px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background 0.15s; }
.btn-card-gray:hover { background: #475569; }

.btn-card-green {
  background: #10b981;
  color: #ffffff;
  border: none;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}
.btn-card-green:hover { background: #059669; }

.btn-card-orange {
  background: #f59e0b;
  color: #ffffff;
  border: none;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}
.btn-card-orange:hover { background: #d97706; }

.btn-card-red-cancel {
  background: #ffffff;
  border: 1px solid #ef4444;
  color: #ef4444;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.btn-card-red-cancel:hover { background: #fee2e2; }

/* Create Order Form Elements */
.create-order-card { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.03); margin-bottom: 20px; overflow: hidden; }
.create-order-header { background: #f4f5f7; padding: 10px 18px; font-size: 13.5px; font-weight: 600; color: #374151; border-bottom: 1px solid #e5e7eb; }
.create-order-body { padding: 18px 20px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.form-label { font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 6px; display: block; }
.form-label span.req { color: #c91414; margin-left: 2px; }
.form-label span.sub-desc { color: #6b7280; font-weight: 400; font-size: 11px; margin-left: 4px; }
.form-input-text { width: 100%; border: 1px solid #d1d5db; border-radius: 6px; padding: 8px 12px; font-size: 13px; outline: none; color: #1f2937; background: #ffffff; }
.form-input-text:focus { border-color: #c91414; }
.date-input-wrapper { position: relative; }
.date-input-wrapper input { width: 100%; border: 1px solid #d1d5db; border-radius: 6px; padding: 8px 36px 8px 12px; font-size: 13px; outline: none; color: #1f2937; }
.date-input-wrapper input:focus { border-color: #c91414; }
.date-input-wrapper .cal-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #9ca3af; pointer-events: none; font-size: 14px; }
.days-pill-group { display: flex; gap: 6px; margin-top: 6px; }
.day-pill-btn { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px; padding: 2px 10px; font-size: 11px; color: #4b5563; cursor: pointer; transition: all 0.15s; }
.day-pill-btn:hover { background: #fee2e2; color: #c91414; border-color: #fca5a5; }
.currency-input-wrapper { display: flex; width: 100%; }
.currency-input-wrapper input { flex: 1; border: 1px solid #d1d5db; border-right: none; border-top-left-radius: 6px; border-bottom-left-radius: 6px; padding: 8px 12px; font-size: 13px; outline: none; }
.currency-input-wrapper input:focus { border-color: #c91414; }
.currency-input-wrapper .currency-badge { background: #6c757d; color: #ffffff; padding: 8px 14px; font-size: 12.5px; font-weight: 500; border-top-right-radius: 6px; border-bottom-right-radius: 6px; display: flex; align-items: center; justify-content: center; }

.job-types-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 14px; }
.job-type-card { border: 1px solid #d1d5db; border-radius: 8px; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; background: #ffffff; transition: all 0.15s ease; user-select: none; }
.job-type-card:hover { border-color: #c91414; background: #fffafa; }
.job-type-card.active { border: 2px solid #c91414; background: #fff8f8; }
.job-type-info { text-align: center; flex: 1; }
.job-type-title { font-size: 13.5px; font-weight: 600; color: #1f2937; }
.job-type-sub { font-size: 11px; color: #6b7280; margin-top: 2px; }
.job-type-add-icon { border: 1.5px solid #dc2626; border-radius: 4px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; color: #dc2626; font-size: 13px; flex-shrink: 0; }

.print-detail-panel { border: 1px solid #e5e7eb; border-radius: 8px; background: #ffffff; margin-top: 14px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.02); overflow: hidden; }
.print-detail-topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-bottom: 1px solid #e5e7eb; background: #ffffff; }
.print-detail-topbar-title { font-size: 13.5px; font-weight: 600; color: #1f2937; }
.btn-delete-section { background: #ffffff; border: 1px solid #f87171; color: #dc2626; padding: 4px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.btn-delete-section:hover { background: #fee2e2; }
.btn-toggle-section { background: #ffffff; border: 1px solid #d1d5db; color: #4b5563; padding: 4px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.grid-col-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 18px; }
.select-card-btn { border: 1px solid #d1d5db; border-radius: 6px; background: #ffffff; padding: 7px 12px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; transition: all 0.12s ease; font-size: 12.5px; color: #374151; }
.select-card-btn .check-box-indicator { width: 14px; height: 14px; border: 1.5px solid #9ca3af; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 9px; background: #fff; }
.select-card-btn.active { background: #c91414 !important; border-color: #c91414 !important; color: #ffffff !important; font-weight: 600; }
.select-card-btn.active .check-box-indicator { border-color: #ffffff; background: #ffffff; color: #c91414; }
.select-card-btn.active .check-box-indicator::after { content: "✔"; font-weight: 900; }
.matrix-table-wrapper { border: 1px solid #e5e7eb; border-radius: 6px; overflow-x: auto; margin-top: 8px; margin-bottom: 18px; }
.matrix-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.matrix-table th { background: #6c757d; color: #ffffff; padding: 7px 12px; text-align: left; font-weight: 500; border: 1px solid #5a6268; }
.matrix-table td { padding: 8px 12px; border: 1px solid #e5e7eb; vertical-align: top; background: #ffffff; }
.matrix-input-qty { width: 100%; border: 1px solid #d1d5db; border-radius: 4px; padding: 6px 10px; font-size: 13px; text-align: left; outline: none; margin-bottom: 4px; }
.matrix-input-qty:focus { border-color: #c91414; }
.image-dropzone { border: 1.5px dashed #ef4444; border-radius: 8px; background: #ffffff; padding: 34px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: background 0.15s; }
.image-dropzone:hover { background: #fff9f9; }
.upload-cloud-icon { font-size: 32px; color: #9ca3af; margin-bottom: 8px; }
.upload-main-text { font-size: 13px; font-weight: 600; color: #dc2626; margin-bottom: 4px; }
.upload-sub-text { font-size: 11.5px; color: #6b7280; }
.create-order-footer-bar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 24px; margin-bottom: 40px; }
.btn-action-back { background: #ffffff; border: 1px solid #d1d5db; color: #374151; padding: 8px 18px; border-radius: 6px; font-size: 13.5px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn-action-back:hover { background: #f3f4f6; }
.btn-action-submit-red { background: #c91414; border: none; color: #ffffff; padding: 8px 18px; border-radius: 6px; font-size: 13.5px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); transition: background 0.15s; }
.btn-action-submit-red:hover { background: #a80f0f; }

/* SubJob & DeptJob Filters & Cards */
.subjob-filter-container { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 18px 24px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.subjob-filter-row { display: flex; align-items: center; margin-bottom: 12px; font-size: 13.5px; }
.subjob-filter-label { width: 130px; font-weight: 600; color: #1f2937; flex-shrink: 0; }
.subjob-radio-group { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.subjob-radio-label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: #374151; user-select: none; font-size: 13.5px; }
.subjob-radio-label input[type="radio"] { appearance: none; -webkit-appearance: none; width: 17px; height: 17px; border: 1.5px solid #9ca3af; border-radius: 50%; outline: none; display: inline-grid; place-content: center; cursor: pointer; margin: 0; background: #ffffff; transition: all 0.15s ease; }
.subjob-radio-label input[type="radio"]:checked { background-color: #c91414; border-color: #c91414; }
.subjob-radio-label input[type="radio"]:checked::after { content: "✔"; font-size: 10.5px; color: #ffffff; font-weight: 900; transform: translateY(-0.5px); }
.subjob-search-bottom-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-top: 6px; margin-top: 4px; }
.subjob-daterange-box { display: inline-flex; align-items: stretch; border: 1px solid #d1d5db; border-radius: 6px; overflow: hidden; background: #ffffff; }
.subjob-daterange-box input { border: none; outline: none; padding: 6px 10px; font-size: 13px; width: 110px; text-align: center; color: #374151; }
.subjob-daterange-box .date-sep { background: #6c757d; color: #ffffff; display: flex; align-items: center; justify-content: center; padding: 0 14px; font-size: 13px; font-weight: 400; }
.subjob-input-text { border: 1px solid #d1d5db; border-radius: 6px; padding: 6px 12px; font-size: 13.5px; outline: none; color: #374151; width: 200px; }
.subjob-input-text:focus { border-color: #c91414; }
.subjob-btn-clear { background: #ffffff; border: 1px solid #d1d5db; color: #4b5563; padding: 6px 20px; border-radius: 6px; font-size: 13px; cursor: pointer; transition: background 0.15s; }
.subjob-btn-clear:hover { background: #f3f4f6; }
.subjob-btn-search { background: #c91414; border: 1px solid #c91414; color: #ffffff; padding: 6px 22px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.15s; }
.subjob-btn-search:hover { background: #a80f0f; }

.subjob-exact-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.03); overflow: hidden; transition: all 0.3s; }
.subjob-exact-header { background: #e9ecef; padding: 10px 18px; border-bottom: 1px solid #dee2e6; display: flex; justify-content: space-between; align-items: center; }
.subjob-exact-header-left { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #1f2937; }
.subjob-star-icon { color: #f59e0b; font-size: 15px; }
.subjob-status-pill-gray { background: #5c6773; color: #ffffff; font-size: 12px; font-weight: 500; padding: 3px 12px; border-radius: 14px; display: inline-flex; align-items: center; gap: 5px; }
.subjob-exact-code { font-size: 14px; font-weight: 600; color: #374151; }
.subjob-exact-body { background: #ffffff; padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; color: #374151; flex-wrap: wrap; gap: 12px; }
.subjob-btn-action-gray { background: #5c6773; color: #ffffff; border: none; padding: 6px 16px; border-radius: 6px; font-size: 13px; font-weight: 400; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background 0.15s; }
.subjob-btn-action-gray:hover { background: #475569; }

/* SubJob Timeline & Detail View */
.sjd-header-bar { display: flex; justify-content: space-between; align-items: center; background: #ffffff; padding: 12px 20px; border-radius: 8px; border: 1px solid #e5e7eb; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.sjd-grid { display: grid; grid-template-columns: 4.8fr 7.2fr; gap: 22px; align-items: start; }
.sjd-panel { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 22px; box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
.sjd-left-top { display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; border-bottom: 1px solid #f1f5f9; margin-bottom: 22px; }
.sjd-status-badge { background: #5c6773; color: #ffffff; font-size: 12px; padding: 4px 14px; border-radius: 14px; display: inline-flex; align-items: center; gap: 6px; }
.sjd-progress-box { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #4b5563; }
.sjd-progress-bar-bg { width: 80px; height: 8px; background: #e2e8f0; border-radius: 6px; overflow: hidden; }
.sjd-progress-bar-fill { height: 100%; background: #2563eb; width: 0%; transition: width 0.3s; }
.sjd-timeline-container { position: relative; padding-left: 28px; }
.sjd-timeline-container::before { content: ""; position: absolute; left: 11px; top: 14px; bottom: 24px; width: 2px; background: #d1d5db; }
.sjd-step-row { position: relative; display: flex; justify-content: space-between; align-items: center; margin-bottom: 34px; }
.sjd-step-row:last-child { margin-bottom: 10px; }
.sjd-step-dot { position: absolute; left: -28px; width: 24px; height: 24px; border-radius: 50%; background: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 16px; z-index: 2; }
.sjd-step-dot.active { color: #2563eb; }
.sjd-step-dot.waiting { color: #9ca3af; }
.sjd-step-title { font-size: 13.5px; font-weight: 600; color: #1f2937; }
.sjd-step-sub { font-size: 11.5px; color: #6b7280; font-weight: normal; }
.sjd-btn-start { background: #ffffff; border: 1px solid #d1d5db; color: #4b5563; padding: 4px 14px; border-radius: 4px; font-size: 12px; cursor: pointer; transition: all 0.15s; }
.sjd-btn-start:hover { background: #f8fafc; border-color: #9ca3af; }
.sjd-btn-start.done { background: #ecfdf5; border-color: #10b981; color: #059669; }
.sjd-right-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid #f1f5f9; }
.sjd-right-title { font-size: 14.5px; font-weight: 700; color: #1f2937; }
.sjd-btn-main-order { background: #ffffff; border: 1px solid #ef4444; color: #ef4444; padding: 4px 14px; border-radius: 4px; font-size: 12.5px; cursor: pointer; transition: all 0.15s; }
.sjd-btn-main-order:hover { background: #fee2e2; }
.sjd-img-gallery { display: flex; gap: 14px; margin-bottom: 14px; }
.sjd-img-box { width: 120px; height: 120px; border: 1px solid #e5e7eb; border-radius: 6px; padding: 4px; background: #fafafa; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sjd-img-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sjd-info-list { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: #374151; margin-bottom: 16px; }
.sjd-info-list div { line-height: 1.5; }
.sjd-info-list strong { color: #111827; font-weight: 600; }
.sjd-spec-table { width: 100%; border-collapse: collapse; border: 1px solid #d1d5db; font-size: 12.5px; margin-bottom: 12px; }
.sjd-spec-table th { background: #7d858c; color: #ffffff; padding: 8px 12px; text-align: center; font-weight: 500; border: 1px solid #6c757d; }
.sjd-spec-table td { border: 1px solid #e5e7eb; padding: 6px 10px; text-align: center; color: #374151; vertical-align: middle; background: #ffffff; }
.sjd-short-top { font-weight: 600; font-size: 13px; color: #1f2937; }
.sjd-short-sub { font-size: 11px; color: #6b7280; border-top: 1px solid #f1f5f9; margin-top: 4px; padding-top: 2px; }

/* Dashboard Styles */
.dashboard-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.kpi-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.03); display: flex; flex-direction: column; justify-content: space-between; transition: all 0.2s ease; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.07); }
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.kpi-label { font-size: 13px; color: #64748b; font-weight: 500; }
.kpi-icon-box { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.kpi-icon-red { background: #fee2e2; color: #dc2626; }
.kpi-icon-blue { background: #dbeafe; color: #2563eb; }
.kpi-icon-emerald { background: #d1fae5; color: #059669; }
.kpi-icon-amber { background: #fef3c7; color: #d97706; }
.kpi-value-main { font-size: 24px; font-weight: 700; color: #1e293b; line-height: 1.2; margin-bottom: 6px; }
.kpi-bottom-sub { font-size: 12px; color: #64748b; display: flex; gap: 8px; flex-wrap: wrap; }
.kpi-badge-pill { font-size: 11px; padding: 2px 7px; border-radius: 10px; font-weight: 600; }
.kpi-pill-green { background: #dcfce7; color: #166534; }
.kpi-pill-red { background: #fee2e2; color: #991b1b; }
.kpi-pill-gray { background: #f1f5f9; color: #475569; }

.dashboard-row-2col { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; margin-bottom: 22px; }
.dashboard-panel { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 20px 22px; box-shadow: 0 1px 3px rgba(0,0,0,0.03); }
.panel-header-title { font-size: 15px; font-weight: 700; color: #1e293b; display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid #f1f5f9; }
.panel-header-title a { font-size: 12.5px; font-weight: 500; color: #c91414; text-decoration: none; cursor: pointer; }
.panel-header-title a:hover { text-decoration: underline; }

.stat-bar-group { margin-bottom: 16px; }
.stat-bar-header { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; color: #334155; }
.stat-bar-container { width: 100%; height: 9px; background: #f1f5f9; border-radius: 10px; overflow: hidden; display: flex; }
.stat-bar-fill { height: 100%; transition: width 0.4s ease; }

.dept-workload-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.dept-workload-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: all 0.15s; }
.dept-workload-box:hover { background: #fffafa; border-color: #c91414; transform: translateY(-1px); }
.dept-workload-name { font-size: 13px; font-weight: 600; color: #334155; }
.dept-workload-count { font-size: 15px; font-weight: 700; color: #c91414; background: #ffffff; padding: 3px 10px; border-radius: 12px; border: 1px solid #fecaca; }
.quick-actions-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-quick-action { background: #f8fafc; border: 1px solid #cbd5e1; color: #334155; padding: 7px 15px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all 0.15s; }
.btn-quick-action:hover { background: #c91414; border-color: #c91414; color: #ffffff; }

@media (max-width: 992px) {
  .metric-grid-3 { grid-template-columns: 1fr; }
  .radio-grid-5, .radio-grid-6, .grid-col-6 { grid-template-columns: repeat(3, 1fr); }
  .form-grid-3, .form-grid-4, .job-types-grid { grid-template-columns: 1fr; }
  .sjd-grid { grid-template-columns: 1fr; }
  .dashboard-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-row-2col { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .radio-grid-5, .radio-grid-6, .grid-col-6 { grid-template-columns: repeat(2, 1fr); }
  .order-card-header-mid { flex-direction: column; align-items: flex-start; gap: 8px; }
  .dashboard-kpi-grid { grid-template-columns: 1fr; }
  .dept-workload-grid { grid-template-columns: 1fr; }
}