/* ============================================
   utilities.css — 全站工具類樣式（v103.0.39）
   -------------------------------------------------
   v103.0.39（B30-3-2）：
     ✅ 硬編碼深色改走變數
   v101.6.6 修正：
     ✅ 移除 .tab-bar / .data-card 重複樣式
   ============================================ */

/* ============================================
   1. 名稱截斷
   ============================================ */
.truncate {
  display: inline-block;
  max-width: 12em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

@media (max-width: 640px) {
  .truncate { max-width: 6em; }
}

.truncate-expandable {
  cursor: pointer;
  border-bottom: 1px dashed var(--glass-border-hover);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.truncate-expandable:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.truncate-expandable.expanded {
  max-width: none;
  overflow: visible;
  white-space: normal;
  word-break: break-word;
}

/* ============================================
   2. 手機卡片化表格
   ============================================ */
@media (max-width: 640px) {
  .data-table.mobile-cards {
    display: block;
    border: none;
    min-width: 0 !important;
  }
  .data-table.mobile-cards thead { display: none; }
  .data-table.mobile-cards tbody { display: block; }
  .data-table.mobile-cards tbody tr {
    display: block;
    margin-bottom: 10px;
    padding: 14px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
  }
  .data-table.mobile-cards tbody tr:hover td { background: transparent; }
  .data-table.mobile-cards td {
    display: block;
    padding: 4px 0;
    border: none;
    font-size: 13px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .data-table.mobile-cards td[data-label]::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 70px;
    color: var(--text-muted);
    font-size: 11px;
    margin-right: 8px;
  }
  .data-table.mobile-cards td.hide-mobile,
  .data-table.mobile-cards th.hide-mobile {
    display: none !important;
  }
  .data-table.mobile-cards td[data-primary] {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
  }
  .data-table.mobile-cards td[data-primary]::before { display: none; }
  .data-table.mobile-cards td[data-label="金額"],
  .data-table.mobile-cards td.num {
    text-align: right;
    font-family: var(--font-mono);
    font-weight: 700;
  }
  .data-table.mobile-cards td[data-label="操作"] {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .data-table.mobile-cards td[data-label="操作"]::before { display: none; }
  .data-table.mobile-cards td[data-label="狀態"] {
    display: flex;
    align-items: center;
    gap: 6px;
  }
}

/* ============================================
   3. 間距工具
   ============================================ */
.mt-0  { margin-top: 0 !important; }
.mt-4  { margin-top: 4px !important; }
.mt-8  { margin-top: 8px !important; }
.mt-12 { margin-top: 12px !important; }
.mt-16 { margin-top: 16px !important; }
.mt-20 { margin-top: 20px !important; }
.mt-24 { margin-top: 24px !important; }

.mb-0  { margin-bottom: 0 !important; }
.mb-4  { margin-bottom: 4px !important; }
.mb-8  { margin-bottom: 8px !important; }
.mb-12 { margin-bottom: 12px !important; }
.mb-16 { margin-bottom: 16px !important; }
.mb-20 { margin-bottom: 20px !important; }
.mb-24 { margin-bottom: 24px !important; }

.ml-4  { margin-left: 4px !important; }
.ml-8  { margin-left: 8px !important; }
.mr-4  { margin-right: 4px !important; }
.mr-8  { margin-right: 8px !important; }

.p-0  { padding: 0 !important; }
.p-4  { padding: 4px !important; }
.p-8  { padding: 8px !important; }
.p-12 { padding: 12px !important; }
.p-16 { padding: 16px !important; }
.p-20 { padding: 20px !important; }

.gap-4  { gap: 4px !important; }
.gap-6  { gap: 6px !important; }
.gap-8  { gap: 8px !important; }
.gap-12 { gap: 12px !important; }
.gap-16 { gap: 16px !important; }
.gap-20 { gap: 20px !important; }

/* ============================================
   4. Flex / 對齊
   ============================================ */
.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap     { flex-wrap: wrap; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-end   { justify-content: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-1        { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* ============================================
   5. 文字
   ============================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }
.text-xs     { font-size: 11px; }
.text-sm     { font-size: 12px; }
.text-base   { font-size: 14px; }
.text-lg     { font-size: 16px; }
.text-xl     { font-size: 18px; }
.text-bold   { font-weight: 700; }
.text-mono   { font-family: var(--font-mono); }

.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   6. 顯示
   ============================================ */
.hidden       { display: none !important; }
.block        { display: block !important; }
.inline-block { display: inline-block !important; }

/* ============================================
   7. 分隔線
   ============================================ */
.divider {
  height: 1px;
  background: var(--divider-strong);
  margin: 16px 0;
}

.divider-dashed {
  height: 0;
  border-top: 1px dashed var(--divider-strong);
  margin: 16px 0;
}

/* ============================================
   8. 快速摘要卡
   ============================================ */
.quick-summary-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 16px;
}

.quick-summary-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 1px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
}

.quick-summary-row .label { color: var(--text-secondary); }

.quick-summary-row .value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

@media (max-width: 640px) {
  .quick-summary-card { padding: 16px; }
  .quick-summary-row { font-size: 12px; }
}

/* ============================================
   9. 內容區最小高度
   ============================================ */
.content-min-height {
  min-height: calc(100vh - 64px - 48px);
}

@media (max-width: 640px) {
  .content-min-height {
    min-height: calc(100vh - 64px - 32px);
  }
}

/* ═══════════════════════════════════════════
   END OF FILE
   File: css/utilities.css
   Version: v103.0.39
   Batch: B30-3-2
   ═══════════════════════════════════════════ */