* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft JhengHei", "Noto Sans TC", sans-serif; background: #f4f6f9; color: #333; }
.navbar { background: #1e3a5f; color: #fff; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: bold; }
.nav-logo { height: 32px; width: auto; max-width: 120px; object-fit: contain; background: #fff; padding: 2px 4px; border-radius: 4px; }
.nav-links a { color: #cfd8dc; text-decoration: none; margin-right: 16px; padding: 6px 10px; border-radius: 4px; }
.nav-links a:hover, .nav-links a.active { background: #2c5282; color: #fff; }
.nav-user { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.container { max-width: 1320px; margin: 24px auto; padding: 0 16px; }
.card { background: #fff; border-radius: 6px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); overflow-x: auto; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-left: 4px solid #1e3a5f; padding: 16px 20px; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.stat-num { font-size: 28px; font-weight: bold; color: #1e3a5f; margin-top: 6px; }
h1, h2, h3 { margin-top: 0; color: #1e3a5f; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th, td { padding: 10px 12px; border-bottom: 1px solid #e2e8f0; text-align: left; font-size: 14px; }
th { background: #f8fafc; color: #334155; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: #475569; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], select, textarea {
    width: 100%; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 14px;
}
.btn { display: inline-block; white-space: nowrap; padding: 8px 14px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; text-decoration: none; background: #1e3a5f; color: #fff; }
.btn:hover { background: #2c5282; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: #059669; }
.btn-success:hover { background: #047857; }
.btn-outline { background: transparent; border: 1px solid #fff; color: #fff; }
.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.badge { padding: 3px 8px; border-radius: 12px; font-size: 12px; background: #e2e8f0; }
.badge-draft { background: #e2e8f0; color: #334155; }
.badge-sent { background: #dbeafe; color: #1e40af; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.login-box { max-width: 400px; margin: 70px auto; background: #fff; padding: 28px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.login-logo-wrap { text-align: center; margin-bottom: 14px; }
.login-logo { max-width: 200px; max-height: 80px; width: auto; height: auto; object-fit: contain; }
.footer { text-align: center; padding: 20px; font-size: 12px; color: #64748b; }

/* 分頁列樣式 */
.pagination-bar { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 16px; font-size: 13px; color: #475569; text-align: center; }
.pagination { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.page-btn { padding: 5px 10px; border: 1px solid #cbd5e1; border-radius: 4px; text-decoration: none; color: #1e3a5f; background: #fff; }
.page-btn:hover { background: #e2e8f0; }
.page-btn.active { background: #1e3a5f; color: #fff; border-color: #1e3a5f; font-weight: bold; }
.page-btn.disabled { color: #94a3b8; pointer-events: none; background: #f8fafc; }

/* 操作欄不換行與長公司名稱自動折行 */
th, td { vertical-align: middle; }
th:last-child, td:last-child:not([colspan]) { white-space: nowrap; width: 1%; }
td.col-company { max-width: 220px; white-space: normal; word-break: break-word; overflow-wrap: anywhere; }

/* 可搜尋下拉選單 (Combobox) */
.combo-wrap { position: relative; }
.combo-input-box { position: relative; display: flex; align-items: center; }
.combo-input-box input { padding-right: 48px; }
.combo-btn { position: absolute; right: 6px; background: none; border: none; color: #64748b; cursor: pointer; font-size: 13px; padding: 4px 5px; line-height: 1; }
.combo-btn:hover { color: #1e3a5f; }
.combo-clear { right: 26px; font-size: 15px; display: none; }
.combo-list { display: none; position: absolute; top: 100%; left: 0; right: 0; max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid #cbd5e1; border-top: none; border-radius: 0 0 4px 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.12); z-index: 100; }
.combo-item { padding: 8px 10px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.combo-item:hover, .combo-item.active { background: #eff6ff; color: #1e3a5f; }
.combo-item.selected { font-weight: bold; background: #e0f2fe; }
.combo-empty { padding: 10px; font-size: 13px; color: #94a3b8; text-align: center; }
