.after-sales-page { background: #f4f7fb; }
.after-sales-page .app-header-inner { justify-content: space-between; gap: 16px; }
.after-sales-page .app-title { flex: 1; text-align: center; }
.after-sales-shell { max-width: 1500px; margin: 0 auto; padding: 20px; display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; }
.case-sidebar, .case-detail { background: #fff; border: 1px solid #dfe5ec; border-radius: 10px; box-shadow: 0 2px 10px rgba(15, 23, 42, .05); }
.case-sidebar { align-self: start; position: sticky; top: 88px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; overflow: hidden; }
.case-sidebar-head { padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e8edf3; }
.case-sidebar-head h2 { margin: 0; font-size: 18px; }
.case-sidebar-head p { margin: 4px 0 0; color: #718096; font-size: 12px; }
.case-filters { padding: 12px 18px; display: grid; gap: 8px; border-bottom: 1px solid #e8edf3; }
.case-filters input, .case-filters select, .after-sales-modal input, .after-sales-modal select, .after-sales-modal textarea, .case-status-select { width: 100%; border: 1px solid #d7dee8; border-radius: 7px; padding: 9px 11px; font: inherit; background: #fff; box-sizing: border-box; }
.case-filters input:focus, .case-filters select:focus, .after-sales-modal input:focus, .after-sales-modal select:focus, .after-sales-modal textarea:focus { outline: none; border-color: #0b7ee8; box-shadow: 0 0 0 3px rgba(11, 126, 232, .12); }
.case-list { overflow-y: auto; padding: 8px; }
.case-list-item { width: 100%; text-align: left; border: 0; background: transparent; padding: 12px; border-radius: 8px; cursor: pointer; color: #172033; }
.case-list-item:hover { background: #f2f7fc; }
.case-list-item.active { background: #eaf4ff; box-shadow: inset 3px 0 #0b7ee8; }
.case-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.case-item-title { font-weight: 650; line-height: 1.4; }
.case-item-meta { margin-top: 7px; color: #64748b; font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.status-badge { white-space: nowrap; border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 600; }
.status-pending { background: #fff3cd; color: #8a5a00; }
.status-inspecting { background: #e8f2ff; color: #0b63b6; }
.status-closed { background: #e7f7ed; color: #18743a; }
.case-detail { min-height: 680px; padding: 22px; }
.case-detail-empty { min-height: 580px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #718096; text-align: center; }
.case-detail-empty h2 { color: #263247; margin: 14px 0 4px; }
.empty-icon { width: 72px; height: 72px; border-radius: 20px; background: #eaf4ff; color: #0b7ee8; display: grid; place-items: center; font-weight: 700; }
.case-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid #e5eaf0; }
.case-detail-title h2 { margin: 0; font-size: 24px; }
.case-detail-title p { color: #64748b; margin: 8px 0 0; }
.case-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.case-status-select { width: auto; min-width: 105px; padding: 7px 9px; }
.case-audit-meta { padding: 12px 0 2px; color: #718096; font-size: 12px; line-height: 1.6; }
.report-section { margin-top: 16px; padding: 18px; border: 1px solid #dfe5ec; border-radius: 12px; background: #fff; }
.report-section > h3, .brewing-report-head h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 14px; font-size: 18px; }
.report-section h3 > span { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #0b7ee8; color: #fff; font-size: 13px; flex: 0 0 auto; }
.report-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.report-text { min-height: 44px; padding: 13px; border-radius: 8px; background: #f8fafc; color: #334155; white-space: pre-wrap; line-height: 1.75; overflow-wrap: anywhere; }
.reinspection-report { border-color: #efd7b8; background: #fffdf9; }
.fixed-inspection-list { display: grid; gap: 12px; margin-top: 15px; }
.fixed-inspection-card { padding: 15px; border: 1px solid #eadfce; border-radius: 10px; background: #fff; }
.fixed-inspection-card h4 { margin: 0 0 10px; color: #30271f; }
.fixed-inspection-photos { margin-top: 12px; }
.fixed-photo-empty { color: #94a3b8; font-size: 12px; }
.report-subsection-title { margin-top: 18px; padding-top: 17px; border-top: 1px solid #efdfca; }
.report-subsection-title h4 { margin: 0; font-size: 16px; }
.report-subsection-title p { margin: 4px 0 0; color: #7b6b59; font-size: 12px; }
.conclusion-report { border-color: #d9e4f2; }
.case-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 18px 0; }
.overview-card { border: 1px solid #e3e8ef; background: #fbfcfe; border-radius: 8px; padding: 13px; min-width: 0; }
.overview-label { color: #718096; font-size: 12px; margin-bottom: 6px; }
.overview-value { color: #1e293b; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.overview-card.wide { grid-column: span 3; }
.timeline-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 14px; }
.timeline-toolbar h3 { margin: 0; }
.stage-list { display: grid; gap: 14px; }
.stage-card { border: 1px solid #dfe5ec; border-radius: 9px; overflow: hidden; background: #fff; }
.stage-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px; background: #f8fafc; border-bottom: 1px solid #e7ebf0; }
.stage-index { display: inline-grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #0b7ee8; color: #fff; font-size: 12px; margin-right: 9px; }
.stage-title { font-weight: 650; }
.stage-type { color: #718096; font-size: 12px; margin-top: 4px; }
.stage-actions { display: flex; gap: 6px; }
.stage-body { padding: 16px; }
.stage-content { white-space: pre-wrap; line-height: 1.7; color: #334155; }
.stage-empty { color: #94a3b8; font-style: italic; }
.stage-meta-grid { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; color: #5f6b7b; font-size: 13px; }
.stage-meta-grid strong { color: #334155; }
.tag-list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.stage-tag { background: #fff3ec; color: #d55c22; border: 1px solid #ffdfcf; border-radius: 999px; padding: 4px 9px; font-size: 12px; }
.attachment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 15px; }
.attachment-card { border: 1px solid #e1e6ed; border-radius: 8px; overflow: hidden; background: #fff; }
.attachment-card img { width: 100%; height: 130px; object-fit: cover; display: block; cursor: zoom-in; background: #eef2f6; }
.attachment-info { padding: 9px; }
.attachment-caption { min-height: 20px; font-size: 12px; color: #475569; overflow-wrap: anywhere; }
.attachment-actions { display: flex; gap: 6px; margin-top: 8px; }
.upload-row { margin-top: 14px; padding-top: 14px; border-top: 1px dashed #d9e0e8; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.upload-row input[type="file"] { max-width: 240px; font-size: 12px; }
.upload-limit { margin-top: 12px; color: #94a3b8; font-size: 12px; }
.form-section-title { margin-top: 4px; padding: 10px 0 2px; border-top: 1px solid #e5eaf0; color: #1e293b; font-weight: 700; }
.brewing-report { margin: 4px 0 22px; padding: 18px; border: 1px solid #f0d8bc; border-radius: 12px; background: #fffdf9; }
.brewing-report-head, .brewing-round-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.brewing-report h3 { margin: 0; }
.brewing-report-head p, .brewing-round-toolbar p { margin: 5px 0 0; color: #7b6b59; font-size: 12px; }
.brewing-condition-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.brewing-condition-grid .overview-card { background: #fff; border-color: #eadfce; }
.brewing-notes { margin-top: 10px; padding: 12px; border-radius: 8px; background: #fff; color: #5f5143; white-space: pre-wrap; line-height: 1.6; }
.brewing-round-toolbar { margin-top: 20px; padding-top: 18px; border-top: 1px solid #efdfca; }
.brew-round-list { display: grid; gap: 12px; margin-top: 13px; }
.brew-round-card { overflow: hidden; border: 1px solid #eadfce; border-radius: 10px; background: #fff; }
.brew-round-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; background: #fff8ee; border-bottom: 1px solid #f1e3d0; }
.brew-round-number { display: inline-grid; place-items: center; width: 25px; height: 25px; margin-right: 8px; border-radius: 50%; background: #e8782f; color: #fff; font-size: 12px; }
.brew-round-body { padding: 15px; }
.brew-time { float: right; margin-left: 12px; color: #8b735c; font-size: 13px; }
.modal-overlay { display: none; }
.modal-overlay.show { display: flex; }
.after-sales-modal { width: min(720px, calc(100vw - 32px)); max-height: 88vh; overflow-y: auto; }
.after-sales-modal h3 { margin-top: 0; }
.after-sales-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.after-sales-form-grid .form-group { margin: 0; }
.after-sales-form-grid .full { grid-column: 1 / -1; }
.after-sales-form-grid label { display: block; margin-bottom: 6px; font-size: 13px; color: #475569; font-weight: 600; }
.after-sales-form-grid textarea { min-height: 92px; resize: vertical; }
.form-hint { color: #718096; font-size: 12px; line-height: 1.6; }
.fixed-report-editor { padding: 13px; border: 1px solid #e6dfd5; border-radius: 9px; background: #fffdf9; }
.draft-report-upload { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e7dccd; }
.draft-report-upload > .btn { margin-right: 7px; }
.draft-brew-section { margin-top: 4px; padding: 15px; border: 1px solid #efdcc4; border-radius: 10px; background: #fffaf3; }
.draft-brew-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.draft-brew-section-head h4 { margin: 0; font-size: 16px; color: #2d241b; }
.draft-brew-section-head p { margin: 4px 0 0; color: #8b735c; font-size: 12px; }
.draft-brew-list { display: grid; gap: 12px; }
.draft-brew-empty { padding: 17px 10px; border: 1px dashed #e4c9a8; border-radius: 8px; color: #9a8065; text-align: center; font-size: 13px; }
.draft-brew-card { padding: 13px; border: 1px solid #ead8c2; border-radius: 9px; background: #fff; }
.draft-brew-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; color: #493a2d; }
.draft-brew-actions { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.draft-brew-actions .btn { min-height: 32px; padding: 5px 9px; font-size: 12px; }
.draft-brew-fields { gap: 10px; }
.draft-brew-fields textarea { min-height: 76px; }
.draft-brew-upload { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 11px; border-top: 1px dashed #e7dccd; }
.draft-brew-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.draft-brew-file-hint { color: #8b735c; font-size: 12px; }
.draft-brew-previews { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.draft-brew-preview { position: relative; overflow: hidden; border: 1px solid #eadfce; border-radius: 7px; background: #f8f4ee; }
.draft-brew-preview img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.draft-brew-preview .btn { width: 100%; min-height: 30px; border-radius: 0; padding: 4px; font-size: 11px; }
.case-save-progress { min-height: 20px; color: #0b63b6; font-size: 12px; }
.case-save-actions { position: sticky; bottom: -1px; z-index: 2; padding: 12px 0 2px; background: var(--surface); border-top: 1px solid #e5eaf0; }
.danger-text { color: #dc2626; }
.empty-state { color: #94a3b8; text-align: center; padding: 28px 14px; }

@media (max-width: 900px) {
  .after-sales-shell { grid-template-columns: 1fr; padding: 12px; }
  .case-sidebar { position: static; max-height: none; }
  .case-list { max-height: 340px; }
  .case-detail { min-height: 460px; padding: 15px; }
  .case-overview { grid-template-columns: 1fr; }
  .report-field-grid { grid-template-columns: 1fr; }
  .overview-card.wide { grid-column: auto; }
  .brewing-condition-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .after-sales-page .app-title { font-size: 16px; text-align: left; }
  .case-detail-header { flex-direction: column; }
  .case-actions { justify-content: flex-start; }
  .after-sales-modal { width: 100vw; max-width: none; max-height: 100dvh; height: 100dvh; border-radius: 0; padding: 18px 14px calc(14px + env(safe-area-inset-bottom)); }
  .after-sales-modal h3 { margin-bottom: 16px; }
  .after-sales-form-grid { grid-template-columns: 1fr; gap: 11px; }
  .after-sales-form-grid .full { grid-column: auto; }
  .attachment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brewing-report { padding: 13px; }
  .report-section { padding: 13px; }
  .brewing-report-head, .brewing-round-toolbar, .brew-round-head { flex-direction: column; }
  .brewing-report-head .btn, .brewing-round-toolbar .btn { width: 100%; }
  .draft-brew-section { padding: 11px; }
  .draft-brew-section-head { align-items: stretch; }
  .draft-brew-section-head .btn { width: 100%; }
  .draft-brew-actions { width: 100%; justify-content: stretch; }
  .draft-brew-actions .btn { flex: 1; }
  .draft-brew-previews { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-save-actions { bottom: -14px; margin: 0 -14px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
}
