* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f5f7;
  color: #1f2430;
}

.screen { min-height: 100vh; }

#loginScreen { display: flex; align-items: center; justify-content: center; }
.login-box {
  background: #fff;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-box h1 { margin: 0 0 8px; font-size: 20px; }
.login-box label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #555; }
.login-box input {
  padding: 10px 12px; border: 1px solid #d7d9e0; border-radius: 8px; font-size: 14px;
}
.login-box button {
  margin-top: 6px; padding: 10px; border: none; border-radius: 8px;
  background: #3b5bfd; color: #fff; font-weight: 600; cursor: pointer;
}
.login-box button:hover { background: #2f49d4; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; background: #fff; border-bottom: 1px solid #e4e6ec;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar-actions { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #666; }

main { padding: 24px; max-width: 1000px; margin: 0 auto; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #eef0f4; font-size: 14px; }
th { background: #f8f9fb; font-weight: 600; color: #444; }

.hint { color: #999; font-size: 12px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-ok { background: #e3f8ea; color: #1c8a44; }
.badge-behind { background: #fdf1df; color: #b9720b; }

.actions-cell { display: flex; gap: 8px; flex-wrap: wrap; }

button.btn-action {
  padding: 6px 12px; border-radius: 6px; border: 1px solid #d7d9e0; background: #fff; cursor: pointer; font-size: 13px;
}
button.btn-action:hover:not(:disabled) { background: #f0f2ff; border-color: #3b5bfd; }
button.btn-action:disabled { opacity: 0.4; cursor: default; }

.btn-secondary {
  padding: 8px 14px; border-radius: 8px; border: 1px solid #d7d9e0; background: #fff; cursor: pointer; font-size: 13px;
}
.btn-secondary:hover { background: #f0f2ff; }
.btn-danger {
  padding: 8px 16px; border-radius: 8px; border: none; background: #d64545; color: #fff; cursor: pointer; font-weight: 600;
}

.message-box { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.message-success { background: #e3f8ea; color: #1c8a44; }
.message-error { background: #fdeaea; color: #b32a2a; }
.error-box { background: #fdeaea; color: #b32a2a; padding: 10px; border-radius: 8px; font-size: 13px; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-content {
  background: #fff; border-radius: 12px; padding: 24px; max-width: 800px; width: 90%;
  max-height: 80vh; overflow-y: auto;
}
.modal-small { max-width: 400px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.btn-close { float: right; background: none; border: none; font-size: 20px; cursor: pointer; }
.audit-detail { max-width: 300px; white-space: pre-wrap; word-break: break-word; font-size: 12px; color: #555; }
