/* Redesigned search bar for modern Bootstrap look */
.rsroc-searchbox {
  position: relative;
  width: 100%;
}
.rsroc-searchbox .form-control {
  padding-left: 2.2rem;
  border-radius: 2rem;
  border: 1px solid var(--rsroc-border);
  box-shadow: 0 1px 3px rgba(26,86,219,0.06);
  font-size: 1.05rem;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.rsroc-searchbox .form-control:focus {
  border-color: var(--rsroc-primary);
  box-shadow: 0 0 0 2px rgba(26,86,219,0.10);
}
.rsroc-searchbox-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--rsroc-text-muted);
  pointer-events: none;
  z-index: 2;
}



/* ============================================================
   RSROC Case List Filter Bar
   ============================================================ */

/* Thinner filter bar and inner padding */
.rsroc-filter-bar {
  background: #fff;
  border: 1px solid var(--rsroc-border);
  border-radius: var(--rsroc-radius);
  box-shadow: 0 2px 8px rgba(26,86,219,0.06);
  margin-bottom: 1.2rem;
}
.bootstrap-select .dropdown-toggle {
  height: 2.5rem;
  min-height: 2.5rem;
  border-radius: 1.5rem !important;
  font-size: 1rem;
  background: #fff;
  border: 1px solid var(--rsroc-border);
  box-shadow: 0 1px 3px rgba(26,86,219,0.06);
  padding: 0.375rem 1.5rem 0.375rem 1rem;
  display: flex;
  align-items: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.bootstrap-select .dropdown-toggle:focus, .bootstrap-select .dropdown-toggle:hover {
  border-color: var(--rsroc-primary);
  box-shadow: 0 0 0 2px rgba(26,86,219,0.10);
}
.bootstrap-select .dropdown-menu {
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(26,86,219,0.10);
  font-size: 1rem;
  padding: 0.5rem 0;
}
.bootstrap-select .dropdown-item {
  border-radius: 0.75rem;
  margin: 0 0.5rem;
  padding: 0.5rem 1rem;
  transition: background 0.15s;
}
.bootstrap-select .dropdown-item.active, .bootstrap-select .dropdown-item:active, .bootstrap-select .dropdown-item:hover {
  background: var(--rsroc-primary-light);
  color: var(--rsroc-primary);
}
.bootstrap-select .dropdown-menu.inner {
  max-height: 260px;
  overflow-y: auto;
}
.bootstrap-select .filter-option {
  font-size: 1rem;
  color: var(--rsroc-text);
  display: flex;
  align-items: center;
}
.bootstrap-select .bs-placeholder {
  color: var(--rsroc-text-muted) !important;
  opacity: 0.85;
}
.bootstrap-select .dropdown-toggle .caret {
  margin-left: 0.5rem;
}
.bootstrap-select .dropdown-toggle {
  box-shadow: none !important;
}
.bootstrap-select .dropdown-toggle:after {
  display: none;
}
.bootstrap-select .dropdown-toggle .filter-option-inner-inner {
  padding-left: 0;
}
.bootstrap-select .dropdown-menu li {
  margin-bottom: 0.1rem;
}
.bootstrap-select .dropdown-menu li:last-child {
  margin-bottom: 0;
}
.bootstrap-select .dropdown-menu .selected span.check-mark {
  color: var(--rsroc-primary);
}
.bootstrap-select .dropdown-menu .selected {
  background: var(--rsroc-primary-light);
  color: var(--rsroc-primary);
}
.bootstrap-select .dropdown-menu .text {
  font-size: 1rem;
}
.bootstrap-select .bs-actionsbox, .bootstrap-select .bs-donebutton {
  padding: 0.5rem 1rem;
}
.bootstrap-select .bs-searchbox input.form-control {
  border-radius: 1rem;
  font-size: 1rem;
  padding: 0.375rem 1rem;
}
.bootstrap-select .bs-searchbox input.form-control:focus {
  border-color: var(--rsroc-primary);
  box-shadow: 0 0 0 2px rgba(26,86,219,0.10);
}
.rsroc-filter-bar .bootstrap-select {
  width: 100% !important;
}
.rsroc-filter-bar .bootstrap-select .dropdown-toggle {
  width: 100%;
  min-width: 120px;
}
.rsroc-filter-bar .bootstrap-select .dropdown-menu {
  width: 100%;
  min-width: 120px;
}
.rsroc-filter-inner {
  background: linear-gradient(90deg, #f8f9fc 60%, #e8f0fe 100%);
  border-radius: var(--rsroc-radius);
  padding: 0.75rem 1rem !important;
}
/* Thinner buttons in filter bar */
.rsroc-filter-bar .btn {
  min-width: 80px;
  font-size: 0.97rem;
  border-radius: 1.5rem;
  box-shadow: 0 1px 2px rgba(26,86,219,0.03);
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}
.rsroc-filter-bar .btn-rsroc-primary {
  background: linear-gradient(90deg, var(--rsroc-primary) 80%, #2563eb 100%);
  border: none;
}
.rsroc-filter-bar .btn-rsroc-primary:hover {
  background: var(--rsroc-primary-dark);
}
.rsroc-filter-bar .btn-rsroc-ghost {
  border: 1px solid var(--rsroc-border);
  background: #f8f9fc;
}
.rsroc-filter-bar .btn-rsroc-ghost:hover {
  background: #e8f0fe;
}

.rsroc-questions-edit-button {
  width: 70px;
}

/* ============================================================
   RSROC Design System — Bootstrap 5 Extended
   基礎色調：丹青 (Primary) + 白 (Surface) + 深灯灰 (Text)
   ============================================================ */

:root {
  --rsroc-primary:       #1a56db;
  --rsroc-primary-dark:  #1041b2;
  --rsroc-primary-light: #e8f0fe;
  --rsroc-surface:       #f8f9fc;
  --rsroc-border:        #e2e8f0;
  --rsroc-text:          #1e293b;
  --rsroc-text-muted:    #64748b;
  --rsroc-success:       #16a34a;
  --rsroc-danger:        #dc2626;
  --rsroc-warning:       #d97706;
  --rsroc-sidebar-width: 240px;
  --rsroc-navbar-height: 56px;
  --rsroc-radius:        0.5rem;
  --rsroc-shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --rsroc-shadow:        0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
}

/* ---- Base ---- */
html {
  font-size: 16px;
  overflow-x: hidden;
}
body {
  font-family: 'Inter', 'Noto Sans TC', system-ui, -apple-system, sans-serif;
  background-color: var(--rsroc-surface);
  color: var(--rsroc-text);
  min-height: 100vh;
  overflow-x: hidden;
}

.rsroc-navbar {
  height: var(--rsroc-navbar-height);
  background: #fff;
  border-bottom: 1px solid var(--rsroc-border);
  box-shadow: var(--rsroc-shadow-sm);
  padding: 0 1.5rem;
}
.rsroc-navbar .navbar-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--rsroc-primary);
  letter-spacing: -0.02em;
}
.rsroc-navbar .nav-link {
  color: var(--rsroc-text-muted);
  font-size: 1rem;
  padding: 0 0.75rem;
  transition: color .15s;
}
.rsroc-navbar .nav-link:hover,
.rsroc-navbar .nav-link.active {
  color: var(--rsroc-primary);
}

/* ---- Page Layout ---- */
.rsroc-page {
  padding: 2rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}
.rsroc-page-header {
  margin-bottom: 1.75rem;
}
.rsroc-page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--rsroc-text);
  margin-bottom: 0.25rem;
}
.rsroc-page-header p {
  color: var(--rsroc-text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ---- Cards ---- */
.rsroc-card {
  background: #fff;
  border: 1px solid var(--rsroc-border);
  border-radius: var(--rsroc-radius);
  box-shadow: var(--rsroc-shadow-sm);
  padding: 1.5rem;
}
.rsroc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rsroc-border);
}
.rsroc-card-header h5 {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
}

/* ---- Buttons ---- */
.btn-rsroc-primary {
  background-color: var(--rsroc-primary);
  border-color: var(--rsroc-primary);
  color: #fff;
  font-weight: 500;
  border-radius: var(--rsroc-radius);
  font-size: 1rem;
  padding: 0.5rem 1rem;
  transition: background-color .15s, border-color .15s;
}
.btn-rsroc-primary:hover {
  background-color: var(--rsroc-primary-dark);
  border-color: var(--rsroc-primary-dark);
  color: #fff;
}
.btn-rsroc-ghost {
  background: transparent;
  border: 1px solid var(--rsroc-border);
  color: var(--rsroc-text);
  font-weight: 500;
  border-radius: var(--rsroc-radius);
  font-size: 1rem;
  padding: 0.5rem 1rem;
  transition: background-color .15s;
}
.btn-rsroc-ghost:hover {
  background: var(--rsroc-surface);
}

/* ---- Forms ---- */
.rsroc-form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--rsroc-text);
  margin-bottom: 0.35rem;
}
.rsroc-form-control {
  border: 1px solid var(--rsroc-border);
  border-radius: var(--rsroc-radius);
  font-size: 1rem;
  padding: 0.55rem 0.85rem;
  color: var(--rsroc-text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.rsroc-form-control:focus {
  border-color: var(--rsroc-primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
  outline: none;
}

/* ---- Tables ---- */
.rsroc-table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
  text-align: left;
  color: #111827;  /* gray-900 */
}
.rsroc-table thead {
  background: #f9fafb;  /* gray-50 */
  border-bottom: 1px solid #e5e7eb;  /* gray-200 */
}
.rsroc-table th {
  background: #f9fafb;
  color: #374151;  /* gray-700 */
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}
.rsroc-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;  /* gray-100 */
  vertical-align: middle;
}
.rsroc-table tbody tr {
  transition: background .15s;
}
.rsroc-table tbody tr:hover {
  background: #eff6ff;  /* blue-50 */
}

/* ---- Status Badges ---- */
.badge-draft    { background: #f1f5f9; color: #64748b;  border: 1px solid #cbd5e1; }
.badge-published{ background: #dcfce7; color: #15803d;  border: 1px solid #86efac; }
.badge-archived { background: #f1f5f9; color: #94a3b8;  border: 1px solid #cbd5e1; }
.badge-upcoming { background: #fef9c3; color: #a16207;  border: 1px solid #fde68a; }
.badge-live     { background: #dbeafe; color: #1d4ed8;  border: 1px solid #93c5fd; }
.badge-closed   { background: #fee2e2; color: #991b1b;  border: 1px solid #fca5a5; }
[class^="badge-"] {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ---- Footer ---- */
.rsroc-footer {
  border-top: 1px solid var(--rsroc-border);
  padding: 1rem 1.5rem;
  font-size: 0.8rem;
  color: var(--rsroc-text-muted);
  text-align: center;
}

/* ---- Utilities ---- */
.text-rsroc-primary { color: var(--rsroc-primary); }
.bg-rsroc-surface   { background: var(--rsroc-surface); }
.border-rsroc       { border-color: var(--rsroc-border) !important; }

/* ============================================================
   Admin Shell — Sidebar Layout
   ============================================================ */

.rsroc-shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.rsroc-sidebar {
  width: var(--rsroc-sidebar-width);
  height: 100vh;
  background: #0f172a;  /* slate-900 */
  border-right: none;
  box-shadow: 4px 0 16px rgba(0,0,0,.3);
  padding: 0 0 2rem;
  position: fixed;
  top: 0;
  left: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  transition: width 0.3s cubic-bezier(.4,0,.2,1);
}
/* Collapsed state — toggled via body.sidebar-collapsed */
body.sidebar-collapsed .rsroc-sidebar {
  width: 70px;
}
body.sidebar-collapsed .rsroc-main {
  margin-left: 64px;
}
body.sidebar-collapsed .sidebar-text {
  display: none;
}
body.sidebar-collapsed .rsroc-sidebar-label {
  visibility: hidden;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}
body.sidebar-collapsed .rsroc-sidebar-link {
  justify-content: center;
  padding: 0.65rem 0;
  margin: 2px 8px;
  border-radius: 10px;
}
body.sidebar-collapsed .rsroc-sidebar-link svg {
  margin: 0;
  width: 20px;
  height: 20px;
  opacity: 1;
}
body.sidebar-collapsed .rsroc-sidebar-brand {
  justify-content: center;
  padding: 0;
}

/* Collapsed: circular active icon */
body.sidebar-collapsed .rsroc-sidebar-link.active {
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 6px auto;
  border-radius: 9999px;
  justify-content: center;
  align-items: center;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 6px 14px rgba(37,99,235,.28);
  transform: translateZ(0);
}
body.sidebar-collapsed .rsroc-sidebar-link.active svg {
  width: 20px;
  height: 20px;
  opacity: 1;
  color: #fff;
  stroke: currentColor;
}

/* Sidebar brand / logo area */
.rsroc-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  height: var(--rsroc-navbar-height);
  padding: 0 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  color: #f1f5f9;  /* slate-100 */
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.rsroc-sidebar-brand svg { color: #60a5fa; flex-shrink: 0; }

/* Toggle button */
.rsroc-sidebar-toggle {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: #94a3b8;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color .15s, background .15s, border-color .15s;
  line-height: 1;
}
.rsroc-sidebar-toggle:hover {
  color: #f1f5f9;
  background: #2563eb;
  border-color: #2563eb;
}
body.sidebar-collapsed .rsroc-sidebar-toggle {
  margin-left: 0;
}

.rsroc-sidebar-section {
  padding: 0 0.85rem;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}
.rsroc-sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #334155;  /* slate-700 */
  padding: 0.75rem 0.5rem 0.4rem;
  margin-bottom: 0.25rem;
}
.rsroc-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  color: #94a3b8;  /* slate-400 */
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .18s, color .18s;
  margin: 2px 0;
  white-space: nowrap;
}
.rsroc-sidebar-link:hover {
  background: rgba(255,255,255,.07);
  color: #e2e8f0;
}
.rsroc-sidebar-link.active {
  background: #2563eb;  /* blue-600 */
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px -2px rgba(37,99,235,.5);
}
.rsroc-sidebar-link svg {
  flex-shrink: 0;
  opacity: .75;
  transition: opacity .18s;
}
.rsroc-sidebar-link:hover svg { opacity: 1; }
.rsroc-sidebar-link.active svg { opacity: 1; }

/* Main area transition */
.rsroc-main {
  margin-left: var(--rsroc-sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  transition: margin-left 0.3s ease;
}
.rsroc-main--nosidebar {
  margin-left: 0;
}

/* ---- Top bar (inside main column) ---- */
.rsroc-topbar {
  height: var(--rsroc-navbar-height);
  background: #fff;
  border-bottom: 1px solid var(--rsroc-border);
  box-shadow: var(--rsroc-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 90;
  flex-shrink: 0;
}
.rsroc-topbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--rsroc-text);
  margin: 0;
}

/* ---- Content wrapper ---- */
.rsroc-content {
  padding: 2rem;
  flex: 1;
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

/* ---- Main Content Area ---- */

@media (max-width: 768px) {
  .rsroc-sidebar { display: none; }
  .rsroc-main { margin-left: 0; }
  .rsroc-content { padding: 1.25rem; }
  .rsroc-page-header { flex-wrap: wrap; gap: .5rem; }
  .rsroc-page-title { font-size: 1.25rem; }

  /* 桌機側邊欄收合按鈕在手機上隱藏，避免誤點 */
  #sidebarToggle { display: none !important; }

  /* 手機側邊欄展開時，確保文字標籤顯示（防止 sidebar-collapsed 干擾） */
  body.sidebar-mobile-open .rsroc-sidebar .sidebar-text { display: inline !important; }

  /* ---- Mobile sidebar toggle button ---- */
  .rsroc-mobile-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--rsroc-border);
    border-radius: 8px;
    color: var(--rsroc-text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, color .15s, border-color .15s;
  }
  .rsroc-mobile-sidebar-toggle:hover {
    background: var(--rsroc-primary);
    border-color: var(--rsroc-primary);
    color: #fff;
  }
  /* 預設顯示漢堡，隱藏 X */
  .rsroc-mobile-sidebar-toggle .icon-close { display: none; }
  .rsroc-mobile-sidebar-toggle .icon-menu  { display: block; }
  /* 開啟狀態：顯示 X，隱藏漢堡 */
  body.sidebar-mobile-open .rsroc-mobile-sidebar-toggle .icon-menu  { display: none; }
  body.sidebar-mobile-open .rsroc-mobile-sidebar-toggle .icon-close { display: block; }

  /* ---- Mobile sidebar overlay ---- */
  body.sidebar-mobile-open .rsroc-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: var(--rsroc-sidebar-width);
    height: 100dvh;
    height: 100vh;
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0,0,0,.25);
    animation: slideInLeft .22s ease;
  }

  /* ---- Backdrop ---- */
  .rsroc-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 199;
    backdrop-filter: blur(2px);
  }
  body.sidebar-mobile-open .rsroc-sidebar-backdrop {
    display: block;
  }
}

/* ---- Page Title ---- */
.rsroc-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--rsroc-text);
  margin-bottom: 0.2rem;
}
.rsroc-page-subtitle {
  color: var(--rsroc-text-muted);
  font-size: 0.875rem;
  margin: 0;
}

/* ---- Utilities ---- */
.rsroc-link {
  color: var(--rsroc-primary);
  text-decoration: none;
  font-weight: 500;
}
.rsroc-link:hover { text-decoration: underline; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.cursor-pointer { cursor: pointer; }

/* ---- Wizard Progress ---- */
.wizard-progress {
  display: flex;
  align-items: center;
  gap: 0;
}
.wizard-step-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}
.wizard-step-num {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--rsroc-border);
  font-size: .8rem; font-weight: 600;
  color: var(--rsroc-text-muted);
  background: #fff;
  transition: all .2s;
}
.wizard-step-label {
  font-size: .85rem;
  color: var(--rsroc-text-muted);
  font-weight: 500;
  transition: color .2s;
}
.wizard-step-item.active .wizard-step-num {
  background: var(--rsroc-primary);
  border-color: var(--rsroc-primary);
  color: #fff;
}
.wizard-step-item.active .wizard-step-label { color: var(--rsroc-primary); }
.wizard-step-item.done .wizard-step-num {
  background: var(--rsroc-primary-light);
  border-color: var(--rsroc-primary);
  color: var(--rsroc-primary);
}
.wizard-step-item.done .wizard-step-label { color: var(--rsroc-text); }
.wizard-step-divider {
  flex: 1; height: 2px;
  background: var(--rsroc-border);
  margin: 0 .5rem;
}

/* ---- Checkbox Label (pill style) ---- */
.rsroc-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .75rem;
  border: 1px solid var(--rsroc-border);
  border-radius: 2rem;
  cursor: pointer;
  font-size: .875rem;
  transition: all .15s;
  user-select: none;
}
.rsroc-checkbox-label:hover {
  border-color: var(--rsroc-primary);
  background: var(--rsroc-primary-light);
}
.rsroc-checkbox-label input[type="checkbox"] {
  accent-color: var(--rsroc-primary);
}

/* ---- Input focus style override ---- */
.rsroc-input:focus {
  border-color: var(--rsroc-primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
  outline: none;
}

/* ============================================================
   Case List - Horizontal Scroll & Sticky Columns
   ============================================================ */

.case-list-table-wrapper {
  overflow-x: auto;
  max-width: 100%;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.case-table-scroll-hint {
  padding: .6rem .8rem 0;
  font-size: .78rem;
  color: #64748b;
}

.case-list-table {
  min-width: 1800px;
}

.case-list-table th {
  position: sticky;
  top: 0;
  background: #f9fafb;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.case-list-table td {
  white-space: nowrap;
}

.case-list-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.case-list-table th.sortable:hover {
  background: #f1f5f9;
}

/* ---- Column min-widths ---- */
.case-list-table th:nth-child(1),  .case-list-table td:nth-child(1)  { min-width: 110px; }  /* 案例編號 */
.case-list-table th:nth-child(2),  .case-list-table td:nth-child(2)  { min-width: 130px; }  /* 案例名稱 */
.case-list-table th:nth-child(3),  .case-list-table td:nth-child(3)  { min-width: 100px; }  /* 題目序號 */
.case-list-table th:nth-child(4),  .case-list-table td:nth-child(4)  { min-width: 220px; }  /* 題目 */
.case-list-table th:nth-child(5),  .case-list-table td:nth-child(5)  { min-width:  70px; }  /* 性別 */
.case-list-table th:nth-child(6),  .case-list-table td:nth-child(6)  { min-width:  90px; }  /* 案例年齡 */
.case-list-table th:nth-child(7),  .case-list-table td:nth-child(7)  { min-width: 100px; }  /* 影像類別 */
.case-list-table th:nth-child(8),  .case-list-table td:nth-child(8)  { min-width: 170px; }  /* 臨床症狀 */
.case-list-table th:nth-child(9),  .case-list-table td:nth-child(9)  { min-width: 170px; }  /* 家族史 */
.case-list-table th:nth-child(10), .case-list-table td:nth-child(10) { min-width:  90px; }  /* 開刀史 */
.case-list-table th:nth-child(11), .case-list-table td:nth-child(11) { min-width:  90px; }  /* 吸菸史 */
.case-list-table th:nth-child(12), .case-list-table td:nth-child(12) { min-width: 100px; }  /* 油煙暴露 */
.case-list-table th:nth-child(13), .case-list-table td:nth-child(13) { min-width: 130px; }  /* 標籤 */
.case-list-table th:nth-child(14), .case-list-table td:nth-child(14) { min-width: 110px; }  /* 建立日期 */
.case-list-table th:nth-child(15), .case-list-table td:nth-child(15) { min-width:  90px; }  /* 狀態 */

/* ---- Long-text columns: truncate with ellipsis ---- */
.case-list-table td:nth-child(4),
.case-list-table td:nth-child(8),
.case-list-table td:nth-child(9),
.case-list-table td:nth-child(13) {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sort-icon {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 4px;
  color: #cbd5e1;
  flex-shrink: 0;
}
.case-list-table th.sort-asc  .sort-icon,
.case-list-table th.sort-desc .sort-icon {
  color: var(--rsroc-primary, #0d6efd);
}

.case-list-table .action-column {
  position: sticky;
  right: 0;
  background: #fff;
  z-index: 5;
  box-shadow: -2px 0 4px rgba(0,0,0,0.05);
}

.case-list-table tbody tr:hover .action-column {
  background: #eff6ff;
}

/* ---- TempData success toast ---- */
.rsroc-toast-success {
  position: fixed;
  top: calc(var(--rsroc-navbar-height) + 1rem);
  right: 1.5rem;
  background: var(--rsroc-success);
  color: #fff;
  padding: .6rem 1.25rem;
  border-radius: var(--rsroc-radius);
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--rsroc-shadow-sm);
  z-index: 9999;
  animation: toastIn .25s ease, toastOut .4s ease 2.6s forwards;
}
@keyframes toastIn  { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform:translateY(-8px); } }

.rsroc-toast-warning {
  position: fixed;
  top: calc(var(--rsroc-navbar-height) + 1rem);
  right: 1.5rem;
  background: #b45309;
  color: #fff;
  padding: .6rem 1.25rem;
  border-radius: var(--rsroc-radius);
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--rsroc-shadow-sm);
  z-index: 9999;
  animation: toastIn .25s ease, toastOut .4s ease 3.6s forwards;
}

#imageTypes {
  appearance: none;
  -moz-appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 1px solid var(--rsroc-border);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  color: #333;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  height: auto;
}

#imageTypes:hover {
  border-color: var(--rsroc-primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

#imageTypes:focus {
  outline: none;
  border-color: var(--rsroc-primary-dark);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.2);
}

#imageTypes option {
  padding: 0.5rem;
  background: #fff;
  color: #333;
  cursor: pointer;
}

#imageTypes option:hover {
  background: #f0f0f0;
}

.modal-backdrop.show {
  opacity: .58;
  background-color: #000;
}

