/* React 改寫版：部門管理、部門資料管理的樣式（載入順序在 theme.css、react.css 之後） */

/* ---------- 部門管理列表（Pages/Admin/DepList.jsx） ---------- */
/* 手機版才顯示的部門代碼、名稱、發布狀況（顯示在功能按鈕上方） */
.dep-table .dep-row-meta { display: none; }
.dep-table td, .dep-table th { vertical-align: middle; }
/* 已停用標籤與名稱同一行 */
.dep-table .dep-row-meta .disabled-tag { margin-left: .35rem; }

/* 手機（寬度 < 576px）：原本 DataTables responsive 會把代碼、名稱、最後發布欄收起來，
   改為隱藏這三欄，資訊直接顯示在按鈕上方，不必再點開 */
@media (max-width: 575.98px) {
  .dep-table .dep-col-meta { display: none; }
  .dep-table .dep-row-meta { display: block; margin-bottom: .45rem; line-height: 1.5; font-weight: 500; }
  .dep-table .dep-row-code { display: inline-block; margin-right: .4rem; color: var(--muted); font-size: .85rem; font-weight: 400; }
  .dep-table .dep-row-last { display: block; margin-top: .15rem; font-size: .8rem; font-weight: 400; }
  .dep-table .dep-row-last .ann-date { color: var(--muted); }
  /* 按鈕靠左排列，太窄時換行，不撐出水平捲軸 */
  .dep-table .table-actions { justify-content: flex-start; flex-wrap: wrap; }
  .dep-table th:first-child, .dep-table td:first-child { width: auto !important; }
}

/* ---------- 新增部門：可搜尋的單位下拉選單（取代 Select2，外觀比照 theme.css 的 select2 樣式） ---------- */
.dep-picker { position: relative; }
.dep-picker-toggle { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; text-align: left; background: #fff; cursor: pointer; }
.dep-picker-toggle:focus { outline: none; }
.dep-picker-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.dep-picker-toggle i { color: var(--muted); font-size: .8rem; transition: transform .15s; }
.dep-picker.is-open .dep-picker-toggle i { transform: rotate(180deg); }
.dep-picker-menu {
  position: absolute; z-index: 1050; top: calc(100% + 4px); left: 0; right: 0;
  padding: .5rem; background: #fff; border: 1px solid #cfd8e3; border-radius: 7px;
  box-shadow: 0 8px 24px rgba(15, 39, 66, .12);
}
.dep-picker-menu ul { list-style: none; margin: .4rem 0 0; padding: 0; max-height: 280px; overflow-y: auto; }
.dep-picker-menu li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .4rem .6rem; border-radius: 5px; cursor: pointer; font-size: .92rem; }
.dep-picker-menu li.is-active { background: var(--brand); color: #fff; }
.dep-picker-menu li.is-selected:not(.is-active) { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.dep-picker-menu li.is-disabled { color: #a0aab8; cursor: not-allowed; }
.dep-picker-menu li small { flex: none; font-size: .75rem; color: #a0aab8; }
.dep-picker-menu li.dep-picker-empty { color: var(--muted); cursor: default; }

/* 部門 E-MAIL 輸入框：打「@」後在下方建議 mail.nsysu.edu.tw（Components/admin/EmailInput） */
.email-input { position: relative; }
.email-suggest { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: .3rem; list-style: none; background: #fff; border: 1px solid #cfd8e3; border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 39, 66, .15); }
.email-suggest li { display: flex; align-items: center; gap: .35rem; padding: .45rem .6rem; border-radius: 6px; background: #eef4fb; cursor: pointer; font-size: .92rem; word-break: break-all; }
.email-suggest li i { color: #1d4e89; }
.email-suggest li b { color: #1d4e89; font-weight: 600; }
.email-suggest li small { margin-left: auto; color: #64748b; white-space: nowrap; }
