:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --primary: #1e40af;
  --primary-hover: #1d4ed8;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --danger: #dc2626;
  --success: #16a34a;
  --info: #0284c7;
}
* { box-sizing: border-box; font-family: system-ui, -apple-system, sans-serif; }
body { margin: 0; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.card { background: var(--surface); border-radius: 12px; padding: 24px; box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06); border: 1px solid var(--border); }
.login-card { width: 100%; max-width: 380px; }
h1, h2, h3 { margin: 0 0 8px; }
.subtitle { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
input, .modal-card select { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: var(--surface); }
.btn { padding: 9px 16px; border-radius: 8px; border: none; cursor: pointer; font-size: 14px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; line-height: 1.2; margin: 0; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-edit { background: #e0e7ff; color: var(--primary); padding: 5px 10px; font-size: 12px; }
.btn-danger { background: var(--danger); color: #fff; padding: 5px 10px; font-size: 12px; }
.action-cell { display: flex; gap: 6px; }
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.search-input { flex: 1; min-width: 200px; background: var(--surface); }
.date-input { width: auto; min-width: 140px; padding: 9px 10px; background: var(--surface); }
.filter-select { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: var(--surface); min-width: 170px; }
.count-info { font-size: 12px; color: var(--muted); margin-left: auto; }
.pagination-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--muted); }
.compact-select { min-width: 85px; padding: 6px 8px; font-size: 13px; }
.full { width: 100%; margin-top: 18px; }
.error-text { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }
.hint { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; }
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.app-logo-sm { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.app-logo-lg { width: 88px; height: 88px; border-radius: 18px; object-fit: cover; }
.topbar-right { display: flex; gap: 12px; align-items: center; }
.badge { background: #e0e7ff; color: var(--primary); padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }

.container { max-width: 1200px; margin: 24px auto; padding: 0 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--surface); padding: 16px; border-radius: 10px; border: 1px solid var(--border); }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 24px; font-weight: 700; margin-top: 4px; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { background: var(--surface); border: 1px solid var(--border); padding: 9px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 10px; }
.actions-row { display: flex; gap: 8px; }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
th { background: #f8fafc; font-weight: 700; color: var(--muted); }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--primary); background: #f1f5f9; }
.sort-indicator { margin-left: 4px; font-size: 11px; }
.detail-card { margin-top: 20px; }

.var-ok { color: var(--success); font-weight: 700; }
.var-minus { color: var(--danger); font-weight: 700; }
.var-plus { color: var(--info); font-weight: 700; }

.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { width: 100%; max-width: 440px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
