/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, 'Microsoft JhengHei', sans-serif; font-size: 14px; color: #111827; background: #f9fafb; line-height: 1.5; }
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Navbar ===== */
.navbar { background: #1e3a5f; color: #fff; display: flex; align-items: center; padding: 0 24px; height: 52px; gap: 24px; }
.nav-brand { font-size: 16px; font-weight: 600; color: #fff; }
.nav-links { display: flex; gap: 16px; flex: 1; }
.nav-links a { color: #cbd5e1; font-size: 14px; padding: 4px 8px; border-radius: 4px; }
.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.1); text-decoration: none; }
.nav-user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #94a3b8; }
.nav-user a { color: #94a3b8; }
.nav-user a:hover { color: #fff; }

/* ===== Container ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }

/* ===== Page Header ===== */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.page-header h1 { font-size: 22px; font-weight: 600; }
.page-header .subtitle { color: #6b7280; margin-top: 2px; font-size: 14px; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; border: 1px solid transparent; line-height: 1.4; }
.btn:hover { text-decoration: none; }
.btn-primary { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.btn-primary:hover { background: #1e40af; }
.btn-secondary { background: #fff; color: #374151; border-color: #d1d5db; }
.btn-secondary:hover { background: #f3f4f6; }
.btn-full { width: 100%; justify-content: center; }

/* ===== Filter Bar ===== */
.filter-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.filter-bar select, .filter-bar input { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; background: #fff; }
.record-count { font-size: 13px; color: #6b7280; }

/* ===== Data Table ===== */
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.data-table th { background: #f8fafc; padding: 10px 14px; text-align: left; font-size: 12px; font-weight: 600; color: #6b7280; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
.data-table tr:hover td { background: #f9fafb; }
.data-table .mono { font-family: 'Consolas', monospace; font-size: 12px; }
.data-table .amount { text-align: right; font-family: 'Consolas', monospace; }
.data-table .actions { display: flex; gap: 8px; white-space: nowrap; }
.data-table .empty { text-align: center; color: #9ca3af; padding: 32px; }

/* ===== Badges ===== */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-pending { background: #fef9c3; color: #854d0e; }

/* ===== Form Card ===== */
.form-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); padding: 24px; max-width: 860px; }
.form-section { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid #f3f4f6; }
.form-section:last-of-type { border-bottom: none; }
.form-section h2 { font-size: 15px; font-weight: 600; color: #374151; margin-bottom: 14px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 140px; }
.form-group.flex-2 { flex: 2; }
.form-group label { font-size: 12px; font-weight: 600; color: #374151; }
.form-group input, .form-group select, .form-group textarea {
  padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; background: #fff; color: #111827;
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: #1d4ed8; box-shadow: 0 0 0 3px rgba(29,78,216,0.1); }
.form-group .readonly-field { background: #f9fafb; color: #6b7280; }
.required { color: #dc2626; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* ===== Detail Grid ===== */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.detail-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); padding: 20px; }
.detail-card h2 { font-size: 14px; font-weight: 600; color: #6b7280; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.05em; }
dl { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; }
dt { font-size: 12px; color: #9ca3af; align-self: center; }
dd { font-size: 13px; color: #111827; }
dd.amount { font-family: 'Consolas', monospace; font-size: 14px; }
dd.total { font-size: 16px; font-weight: 600; color: #1d4ed8; }
.empty-state { color: #9ca3af; font-size: 13px; text-align: center; padding: 20px 0; }

/* ===== Login ===== */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #f1f5f9; }
.login-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.1); padding: 40px; width: 100%; max-width: 380px; }
.login-card h1 { font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 4px; color: #1e3a5f; }
.login-subtitle { text-align: center; color: #6b7280; font-size: 14px; margin-bottom: 24px; }
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
