/* ── FEAT-682: Service Charge Refund (scr-*) ───────────────────────── */

/* Page */
.scr-page { padding: 18px 20px; }
.scr-header { margin-bottom: 16px; }
.scr-page-title { font-size: 1.25rem; font-weight: 700; display: block; }
.scr-page-subtitle { font-size: 0.82rem; color: var(--text-muted, #8899aa); display: block; }

/* Main two-column layout */
.scr-main { display: flex; gap: 16px; align-items: flex-start; }
.scr-list-panel { flex: 0 0 55%; min-width: 0; }
.scr-form-panel { flex: 1 1 0; min-width: 0; }

/* List panel header */
.scr-list-header { margin-bottom: 10px; }
.scr-panel-title { font-size: 1rem; font-weight: 600; display: block; margin-bottom: 8px; }
.scr-window-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px;
}
.scr-filter-label { font-size: 0.8rem; color: var(--text-muted, #8899aa); }
.scr-list-export-row { display: flex; gap: 6px; margin-bottom: 6px; }

/* Buttons */
.scr-btn-primary {
  background: #4a9eff; color: #fff; border: none; border-radius: 4px;
  padding: 5px 14px; cursor: pointer; font-size: 0.82rem; font-weight: 600;
}
.scr-btn-primary:hover { background: #2b7de9; }
.scr-btn-primary:disabled { background: #555; cursor: not-allowed; }
.scr-btn-secondary {
  background: transparent; border: 1px solid #4a9eff; color: #4a9eff;
  border-radius: 4px; padding: 5px 12px; cursor: pointer; font-size: 0.82rem;
}
.scr-btn-secondary:hover { background: #1a2a3a; }
.scr-btn-pdf {
  background: #27ae60; color: #fff; border: none; border-radius: 4px;
  padding: 5px 14px; cursor: pointer; font-size: 0.82rem; font-weight: 600;
}
.scr-btn-pdf:hover { background: #1e8449; }
.scr-btn-pdf:disabled { background: #555; cursor: not-allowed; }
.scr-btn-amend {
  background: #e67e22; color: #fff; border: none; border-radius: 4px;
  padding: 5px 14px; cursor: pointer; font-size: 0.82rem; font-weight: 600;
}
.scr-btn-amend:hover { background: #ca6f1e; }
.scr-btn-export {
  background: transparent; border: 1px solid #555; color: inherit;
  border-radius: 4px; padding: 4px 10px; cursor: pointer; font-size: 0.78rem;
}
.scr-btn-export:hover { border-color: #4a9eff; color: #4a9eff; }

/* List table */
.scr-list-body { overflow-x: auto; }
.scr-list-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.scr-table-header th {
  padding: 7px 8px; text-align: left; font-weight: 600; font-size: 0.78rem;
  border-bottom: 2px solid #2c3e50;
}
.scr-list-row td { padding: 6px 8px; border-bottom: 1px solid rgba(128,128,128,0.15); }
.scr-list-row:hover { background: rgba(74,158,255,0.06); }
.scr-select-btn {
  background: none; border: none; cursor: pointer; text-align: left; padding: 0;
  color: #4a9eff; font-size: 0.82rem; text-decoration: underline;
}
.scr-select-btn:hover { color: #2b7de9; }

/* Status badges */
.scr-status-badge { font-size: 0.72rem; border-radius: 3px; padding: 2px 6px; font-weight: 600; }
.scr-status-new     { background: rgba(128,128,128,0.2); color: #aaa; }
.scr-status-saved   { background: rgba(74,158,255,0.2); color: #4a9eff; }
.scr-status-printed { background: rgba(39,174,96,0.2);  color: #27ae60; }
.scr-status-amended { background: rgba(230,126,34,0.2); color: #e67e22; }

/* Flag badges */
.scr-flags-cell { display: flex; flex-wrap: wrap; gap: 3px; }
.scr-flag-badge { font-size: 0.7rem; border-radius: 3px; padding: 1px 5px; font-weight: 600; }
.scr-flag-warn { background: rgba(241,196,15,0.2);  color: #f1c40f; }
.scr-flag-neg  { background: rgba(231,76,60,0.2);   color: #e74c3c; }
.scr-flag-err  { background: rgba(231,76,60,0.3);   color: #e74c3c; }

/* Empty / error states */
.scr-empty-state { padding: 24px; text-align: center; color: var(--text-muted, #8899aa); font-size: 0.85rem; }
.scr-error-state  { padding: 12px; color: #e74c3c; font-size: 0.85rem; }

/* Form panel */
.scr-form-empty {
  padding: 32px; text-align: center; color: var(--text-muted, #8899aa);
  font-size: 0.9rem; border: 1px dashed rgba(128,128,128,0.3); border-radius: 6px;
}

/* Driver card */
.scr-driver-card { margin-bottom: 12px; }
.scr-driver-card-inner {
  background: rgba(74,158,255,0.06); border: 1px solid rgba(74,158,255,0.2);
  border-radius: 6px; padding: 10px 14px;
}
.scr-hero { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.scr-hero-name { font-size: 1.05rem; font-weight: 700; }
.scr-hero-id { font-size: 0.8rem; color: var(--text-muted, #8899aa); }
.scr-card-fields { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.8rem; color: var(--text-muted, #8899aa); }

/* Flags row */
.scr-flags-banner { margin-bottom: 8px; }
.scr-flags-row { display: flex; flex-wrap: wrap; gap: 5px; }

/* Section */
.scr-section { margin-bottom: 14px; }
.scr-section-title {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted, #8899aa); margin-bottom: 6px; border-bottom: 1px solid rgba(128,128,128,0.2);
  padding-bottom: 3px;
}

/* Computed section */
.scr-computed-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 0.85rem; }
.scr-comp-label { color: var(--text-muted, #8899aa); }
.scr-comp-value { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Manual inputs */
.scr-manual-grid {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 10px;
  align-items: center; font-size: 0.83rem;
}
.scr-man-label { color: var(--text-muted, #8899aa); white-space: nowrap; }
.scr-man-input, .scr-man-input-txt {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(128,128,128,0.3);
  border-radius: 4px; padding: 4px 8px; color: inherit; font-size: 0.83rem; width: 100%;
  box-sizing: border-box;
}
.scr-man-input { max-width: 140px; }
.scr-man-ref { font-size: 0.75rem; color: var(--text-muted, #8899aa); grid-column: 2; }

/* Remarks */
.scr-remarks-input {
  width: 100%; background: rgba(255,255,255,0.05); border: 1px solid rgba(128,128,128,0.3);
  border-radius: 4px; padding: 6px 8px; color: inherit; font-size: 0.82rem;
  resize: vertical; min-height: 60px; box-sizing: border-box;
}

/* Refund total */
.scr-refund-total { margin: 10px 0; }
.scr-refund-box {
  display: flex; align-items: center; gap: 10px;
  border: 2px solid rgba(74,158,255,0.3); border-radius: 5px; padding: 8px 14px;
}
.scr-refund-label { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted, #8899aa); }
.scr-refund-amount { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.scr-refund-pos { color: #27ae60; }
.scr-refund-neg { color: #e74c3c; }

/* Evidence collapse */
.scr-evidence-collapse { margin-bottom: 12px; }
.scr-evidence-summary {
  cursor: pointer; font-size: 0.83rem; font-weight: 600; padding: 5px 0;
  color: #4a9eff;
}
.scr-evidence-body { overflow-x: auto; }
.scr-ev-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.scr-ev-table th { padding: 5px 8px; background: rgba(44,62,80,0.5); text-align: left; }
.scr-ev-table td { padding: 4px 8px; border-bottom: 1px solid rgba(128,128,128,0.1); }

/* Action row */
.scr-action-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.scr-action-status { font-size: 0.82rem; color: #27ae60; }

/* Amend modal */
.scr-modal-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); z-index: 1050;
  display: flex; align-items: center; justify-content: center;
}
.scr-modal {
  background: var(--card-bg, #1a2332); border: 1px solid rgba(74,158,255,0.3);
  border-radius: 8px; padding: 24px; max-width: 440px; width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.scr-modal-title { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.scr-modal-body { font-size: 0.85rem; color: var(--text-muted, #8899aa); margin-bottom: 18px; }
.scr-modal-actions { display: flex; gap: 10px; }

/* Override inputs row */
.scr-sc-override-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 8px; padding-top: 6px; border-top: 1px solid rgba(128,128,128,0.15);
}
.scr-sc-override-label { font-size: 0.8rem; color: var(--text-muted, #8899aa); white-space: nowrap; }
.scr-sc-override-reason { flex: 1 1 160px; min-width: 100px; }
.scr-sc-computed-strike { text-decoration: line-through; opacity: 0.55; }
.scr-manual-badge { cursor: help; }
.override-reason-line { font-size: 9pt; margin-top: 6px; font-style: italic; color: #555; }

/* ── Light theme overrides ─────────────────────────────────────────── */
body[data-theme="light"] .scr-page-subtitle,
body[data-theme="light"] .scr-filter-label,
body[data-theme="light"] .scr-hero-id,
body[data-theme="light"] .scr-card-fields,
body[data-theme="light"] .scr-comp-label,
body[data-theme="light"] .scr-man-label,
body[data-theme="light"] .scr-man-ref,
body[data-theme="light"] .scr-empty-state,
body[data-theme="light"] .scr-form-empty,
body[data-theme="light"] .scr-section-title,
body[data-theme="light"] .scr-refund-label,
body[data-theme="light"] .scr-modal-body { color: #666; }

body[data-theme="light"] .scr-driver-card-inner {
  background: rgba(74,158,255,0.05); border-color: rgba(74,158,255,0.3);
}
body[data-theme="light"] .scr-man-input,
body[data-theme="light"] .scr-man-input-txt,
body[data-theme="light"] .scr-remarks-input {
  background: #fff; border-color: #ccc; color: #222;
}
body[data-theme="light"] .scr-list-row td { border-color: rgba(0,0,0,0.06); }
body[data-theme="light"] .scr-ev-table th { background: rgba(44,62,80,0.12); }
body[data-theme="light"] .scr-ev-table td { border-color: rgba(0,0,0,0.06); }
body[data-theme="light"] .scr-btn-secondary { color: #2b7de9; border-color: #2b7de9; }
body[data-theme="light"] .scr-btn-secondary:hover { background: #e8f4ff; }
body[data-theme="light"] .scr-btn-export { color: #444; border-color: #ccc; }
body[data-theme="light"] .scr-btn-export:hover { border-color: #2b7de9; color: #2b7de9; }
body[data-theme="light"] .scr-modal { background: #fff; border-color: rgba(74,158,255,0.3); }
body[data-theme="light"] .scr-form-empty { border-color: #ccc; color: #888; }
body[data-theme="light"] .scr-sc-override-label { color: #666; }
body[data-theme="light"] .scr-status-new { background: rgba(128,128,128,0.1); color: #888; }

/* ── 390px responsive ─────────────────────────────────────────────── */
@media (max-width: 440px) {
  .scr-main { flex-direction: column; }
  .scr-list-panel, .scr-form-panel { flex: 1 1 auto; width: 100%; }
  .scr-window-filters { flex-direction: column; align-items: flex-start; }
  .scr-manual-grid { grid-template-columns: 1fr; }
  .scr-man-input { max-width: 100%; }
  .scr-sc-override-row { flex-direction: column; align-items: flex-start; }
  .scr-sc-override-reason { min-width: 100%; }
  .scr-modal { width: 95%; }
}
